Updated: Please see Auto incrementing build number in Xcode revisited
I’ve recently been doing a bit of iOS development and have started using HockeyApp for distributing beta versions and collecting crash reports. Hockey requires that your builds have a unique version number, they have a great knowledge base article showing How to do versioning for beta versions on iOS or Mac. The only problem I found with their solution was that the file containing the build number needs to exist beforehand. So, here’s an update to the script to create the file if it doesn’t already exist:
Also, don’t forget to add the buildnumber.xcconfig file to your .gitignore.