Skip to content

Instantly share code, notes, and snippets.

@adipurnama
Created May 17, 2019 11:20
Show Gist options
  • Save adipurnama/18477c84a08445c81d1cbff2ba5f5973 to your computer and use it in GitHub Desktop.
Save adipurnama/18477c84a08445c81d1cbff2ba5f5973 to your computer and use it in GitHub Desktop.
XCode increase build number + date
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$PRODUCT_SETTINGS_PATH")
buildNumber=$(cut -d'.' -f2 <<<$buildNumber)
buildNumber=$(date +"%y%m%d")"."$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$PRODUCT_SETTINGS_PATH"
#180925.1008 First is the current date and after the dot the build number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment