Skip to content

Instantly share code, notes, and snippets.

@mwermuth
Created June 2, 2015 08:01
Show Gist options
  • Save mwermuth/a9e57e7eb2fef5c59783 to your computer and use it in GitHub Desktop.
Save mwermuth/a9e57e7eb2fef5c59783 to your computer and use it in GitHub Desktop.
Update Build Number for Apple Watch Extension + App
branch=${1:-'master'}
buildNumber=$(expr $(git rev-list $branch --count) - $(git rev-list HEAD..$branch --count))
appPlistFile=$(echo "${INFOPLIST_FILE}" | sed 's/Extension/App/g')
echo "Updating build number to $buildNumber using branch '$branch' for Watch Extension Target."
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${SRCROOT}/${INFOPLIST_FILE}"
echo "Updating build number to $buildNumber using branch '$branch' for Watch App Target."
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${SRCROOT}/$appPlistFile"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment