What is the best practice to update versionCode when deploying an app to the beta channel in Android?
I wanted to offset the current versionCode by bitrise’s build number, but I haven’t found any custom step for retrieving such information from gradle file.
Is it a good idea to have a totally custom versionCode (currently my version codes are above 100000), so maybe using just bitrise’s build number will suffice?
Another approach is to use current git commit timestamp or number of commits on the current branch. This is often sufficient if app built from given commit is always the same e.g. there is no dynamic dependencies, no content downloaded at the build time nor NDK (version of which can change over the time on bitrise).
It would be nice to have a custom step for this so we could avoid making Bitrise-specific changes to our build. For now, though, this works well. Thanks!
Depends on your setup, the Change Android versionCode and versionName step combined with the Adjust BuildNumber step can provide something like this, if you want to have a simple / static offset & use the Bitrise Build Number for the build number.