Example of "Set Xcode Project Build Number" step

Hi, can you give me an example of “Build Number Offset” and “Version Increment” of “Set Xcode Project Build Number” step that is maintained by you guys. Also, is it possible to increment build and version numbers in this step?

1 Like

Hey @alexanderludvigs! :wave:t2:

For example, if you have a project and its Info.plist’s actual settings are:

  • Bundle Version: 6
  • Bundle Version string, short: 1.2

and you have the Set Xcode project build number step in your workflow with the following setup:

  • Build Number Offset: 6
  • Version Number: 1.2

then the first build you run on this app ($BITRISE_BUILD_NUMBER == 1) will be added to Build Number Offset so the first build versions will be 1.2 (7) and so on.

Hope this helps :blush:
Happy Coding! :tada::rocket:


Thanks for a step-by-step explanation. I am wondering how would I automatically set the Version Number? It is set in Xcode Target settings, specifically in Info.plist, is there a way to fetch it? I don’t want to edit this step every time there is a App version update. Or if I leave that text input blank, will it just use whatever version I have in pList?


Hi @kalmurzayev

Just use the $BITRISE_BUILD_NUMBER, which is an auto-incremented build number (the build number you can see on bitrise.io). That should be the default value of the Set Xcode Project Build Number step’s build_version / Build Number input (https://github.com/bitrise-io/steps-set-xcode-build-number/blob/master/step.yml#L30).

I shared more info about an automatic versioning scheme for CI/CD at https://stackoverflow.com/questions/33821137/build-versioning-in-continuous-delivery/33821876#33821876

If you’d have any questions just let us know! :slight_smile:

1 Like