Skip to content

Instantly share code, notes, and snippets.

@hikui
Created May 21, 2017 07:44
Show Gist options
  • Save hikui/aa6ab1af39d6ff0b22b5eabefe31f5c7 to your computer and use it in GitHub Desktop.
Save hikui/aa6ab1af39d6ff0b22b5eabefe31f5c7 to your computer and use it in GitHub Desktop.
Increase the Build Version When Building Release Configuration
#!/bin/bash
if [ "${CONFIGURATION}" = "Release" ]; then
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment