Is it possible in any way, or, what is the best scenario to programatically update the version code and the version name in an Android Mobile app?
For a mobile app we use:
- Xamarin for Android development
- Visual Studio Team Services for version control (Git), building, testing and releasing.
- Google play for distribution.
our continuous integration flow goes like:
Visual studio (xamarin) ->
Git(Code) ->
Build ->
Test(Xamarin testcloud) ->
Release Google Play (Alpha/Beta/Production)
Currently I have to update the version code/name manually before committing to Git, otherwise, on the other end of the flow, Google will complain the version number of the newly released apk is less or equal than the apk already in the Play Store.
However, since we commit a lot and automatically build-release, we only want to increase the version-code/name only on a successful release (in case google rejects it). This caused this little dilemma: Because then the AndroidManifest, where the versioning resides is already packaged in a signed and zipped APK.
Another thing is: we are working with multiple developers on the project so the manual update thing can cause racing conditions, so the best way is (what we think) to update the version numbers just before release.
Things I thought of:
- storing the version number somewhere in VSTS
- using the build number as the version number
- getting the current version number via the developer API from Google Play
But still a bit stuck and looking for a common / best practice