How to auto-increment build numbers in Xcode
To set up auto-incrementing of build numbers in Xcode, go to the project scheme (⌘+<), click on the grey arrow next to your Build target and put these three lines as the pre-action script:
CFBundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$SRCROOT/$INFOPLIST_FILE")
CFBundleVersion=$(($CFBundleVersion + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $CFBundleVersion" "$SRCROOT/$INFOPLIST_FILE"
Now hit ⌘+B and watch the magic happen.
Written by Milan Cermak
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ios
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#