Set bitrise build number

From Pavel Novik on 2015/11/20 20:33:22 +0000

Allow to set/reset bitrise build number. Will be helpful if i need to match with my project build number.

Copied from original feature request:

From Claudio Sanchez on 2017/01/26 21:55:50 +0000

This is a very important feature when switching CI Pipelines to BitRise.

From Anonymous on 2016/08/03 16:12:44 +0000

+1 I need the ability to reset the build number to start from 1.

From Kyle Newsome on 2016/02/23 20:43:44 +0000

+1 on this feature. We'll use the suggested script for now but it's a bit hacky and unclear to others at a glance where exactly this translation from CI Build # to info.plist Build # is occurring

From Bitrise on 2015/12/04 14:44:16 +0000

You can use this script to offset the build number

We'll provide a built in way to do this, but with this solution it's already possible.

From Zac White on 2015/11/23 07:55:21 +0000

I agree! The lack of this feature makes it difficult to switch existing CI projects to bitrise. I have builds that are currently being distributed with version numbers based on my old CI's build number and I need new builds to have a higher build number.

The build-number-adjust step is now available.
You can change the build number, increase and decrease the build number.

1 Like

Awesome news, thank you @stefandevogelaere! :slight_smile:

Hopefully we can provide a built in solution soon as well, to make the build number consistent (show the same adjusted build number on the UI too), but in any case the new build-number-adjust step should be a good workaround in the meantime :wink:

Hi @viktorbenei

Build number increase works perfectly. But I want to increase the build number locally, to be able to always upload manually (should anything unexpected happen). Is it possible to have Bitrise adopt the build number from the Info.plist? I know this could create some redundancy issues.
Another approach is to enable Bitrise to write back the Bitrise calculated build number to the Info.plist. Would that be possible?

I’d suggest you to specify the build number locally, it’s just a simple environment variable.

If you use the then it can be as simple as:

# set any env var before running the CLI, e.g. the BITRISE_BUILD_NUMBER
# now run the CLI, the BITRISE_BUILD_NUMBER will be available there
bitrise run WORKFLOW

You can of course also specify any env var in the .bitrise.secrets.yml file locally, those will be available as env vars too, there’s no reason why you could not specify BITRISE_BUILD_NUMBER there (in fact in some cases this is exactly what we do in our team :slight_smile: )

We have a few apps already published on Play Store.
For those apps, we have mapped CI’s build number to Android versionCode.

Bitrise doesn’t allow us to skip build numbers, so if we tie build number to versionCode, the built artifacts won’t be able to be published on the Play Store, (because Play Store only allows larger versions for each new apk). Unless we manually fire so many builds until the bitrise number reaches the build number that we already have published in PlayStore, but this would be very tedious and take a long time.

This build-number-adjust work-around step allow us to modify the Android versionCode, but this way we are losing CI’s build number - Android versionCode mapping.

I think having this tern (git commit-hash number - CI’s build number - Android versionCode )
is a really good way to track issues.

It would be great if bitrise supports changing the build number in an arbitrary way. Then this problem would be solved in a definitive way.

1 Like

I definitely agree with you @esteban_mobilenik ! I’ll bring this up for a discussion with the team, to see if we could bump the priority of this task!


I was really shocked, when I found out, that it’s currently not possible to globally/permanently adjust the build number, as this is a really critical issue for us, switching from another CI to Bitrise. We really want, actually need, to continue the build numbers from there, as we use the build number for versioning on iOS as well, and the App Store requires us to increment this for each submission.
Of course we can use the “Adjust BuildNumber” step to work around this issue, but thats not a really nice solution, as then the bitrise web interface shows another build number, than the build actually uses, which is just totally confusing.
So we would really love to see this feature asap.

1 Like

Got it - it’s definitely planned, but no ETA yet unfortunately. Bumped it :wink:

+1ing this - I’m in the middle of migrating everything from BuddyBuild and setting it via a script step isn’t ideal!

We’re working on it :wink:

1 Like

The feature was just released! :rocket: :tada:

Related blog post:

Thanks everyone for supporting this #feature-request! :slight_smile:

1 Like

This topic was automatically closed after 13 days. New replies are no longer allowed.