If you are going to publish your app to App Store Connect or Google Play, each uploaded binary must have a new version. There are several approaches you can use for build versioning on Codemagic. One of the easiest ways to increment app version with every build is by using build arguments and the
BUILD_NUMBER environment variable.
BUILD_NUMBER read-only environment variable holds the total count of builds (including the ongoing build) for this project in Codemagic. In other words, if you have triggered 10 builds for some project in Codemagic, the next time you build it,
BUILD_NUMBER will be exported as
BUILD_NUMBERis counted separately for each workflow.
Incrementing app version
Here are some examples of the build arguments you can use to increment the app version. You can enter the build arguments in App settings > Build > Build arguments.
--build-name=2.0.$BUILD_NUMBER --build-number=$(($BUILD_NUMBER + 100))
--build-number=$(git rev-list HEAD --count)