This is very useful if you use service like TestFlight (if you are not, you should) and in general gives you idea how much you worked and tested.
Hey look, I did 500+ builds for the new version. :)
Anyway, first make sure your project’s Info.plist has
Bundle version (raw key name is
CFBuildVersion) set to integer value,
1 or whatever you want as starting value. In Xcode 4.3 this can be set in Summary tab, the Build field, like this:
Version is what you will market to end users, what you will respond when setting up an update in iTunes Connect. Build is mostly for developers and testers, as a reference for bug tracking/fixing.
Run Script phase in the Build Phases for the main target and paste this script:
1 2 3
It looks like this in Xcode 4.3
Most important thing here is that this
Run Script phase must be before
Copy bundle resources. If you forget that, your builds will always be one step behind.
In the end, if you want to show this in your app, this is one way to do it:
1 2 3 4