iOS versioning with agvtool
Posted on Jul 16, 2014
When search around how to update version number of an iOS project, most of the result is about how to update the info.plist
file using scripts.
Actually, apple provides a command line tool called agvtool to update the version numbers for us. It’s simple and gets the task done.
The thing is, before you know it, it may not be obvious about how to start. So here are the steps.
Steps
-
Setup Xcode project to use apple’s scheme for versioning
In project build settings, set Versioning System to “Apple Generic”
Set Current Project Version to the current build version of the project. -
In command line, check the current build version of the project:
- Set the build version number based on what we got in step 2 and what need to set for next build version.
- Check the current marketing version of the project:
- Set the new marketing version of the project based on what we got in step 4 and what we need for next marketing version.
If you want to increase the version number to the next highest integral value, use agvtool bump -all
instead.
References