How to auto increment the build number in Xcode 5 [duplicate]

Go to Editor -> Add Build Phase -> Add Run Script Build Phase

Add Run Script Build Phase

Go to Build Phases in the project navigator and edit Run Sript.
Change Shell to /bin/bash and paste the following script:

#!/bin/bash
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"

Enter PlistBuddy Script

Don’t forget to change the Build number found under General in the Identity section from 1.0 to 1

Have fun! 🙂

I found this tutorial on Cocoa Factory

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)