Skip to content

Instantly share code, notes, and snippets.

@maxcampolo
Last active August 8, 2016 17:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maxcampolo/18a0e62c2b1d33897822579fda21a6e5 to your computer and use it in GitHub Desktop.
Save maxcampolo/18a0e62c2b1d33897822579fda21a6e5 to your computer and use it in GitHub Desktop.
Auto-increment target build number in Xcode.
#!/bin/bash
# Auto Increment Version Script
buildPlist=$INFOPLIST_FILE
echo $buildPlist
CFSVString=$(/usr/libexec/PlistBuddy -c "Print CFBundleShortVersionString" "$buildPlist")
CFBundleVersion=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$buildPlist")
BUILD_NR=${CFBundleVersion##*.}
BUILD_NR=$(($BUILD_NR + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILD_NR" "$buildPlist"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment