Skip to content

Instantly share code, notes, and snippets.

@DaveAtDog
Created November 5, 2013 16:38
Show Gist options
  • Save DaveAtDog/7321875 to your computer and use it in GitHub Desktop.
Save DaveAtDog/7321875 to your computer and use it in GitHub Desktop.
Auto-increments Build numbers. App (Top left) > Edit Scheme > Build > Pre-actions + Run New Script Action Provide build settings from *APP* Paste in script below. GOTCHA: Insure that your starting build number is set to a whole integer and not a float (e.g. 1, not 1.0)
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PROJECT_DIR}/${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PROJECT_DIR}/${INFOPLIST_FILE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment