Skip to content

Instantly share code, notes, and snippets.

@AlexChesters
Created July 4, 2015 14:28
Show Gist options
  • Select an option

  • Save AlexChesters/a27a5be93958b16a51c2 to your computer and use it in GitHub Desktop.

Select an option

Save AlexChesters/a27a5be93958b16a51c2 to your computer and use it in GitHub Desktop.
Increment build number in Xcode automatically when archiving (add as a build step)
if [ $CONFIGURATION == Release ]; then
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}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment