Skip to content

Instantly share code, notes, and snippets.

@nomadmonad
Created November 14, 2017 09:33
Show Gist options
  • Save nomadmonad/2ed50bd2452d246e48a5ad728854ff2a to your computer and use it in GitHub Desktop.
Save nomadmonad/2ed50bd2452d246e48a5ad728854ff2a to your computer and use it in GitHub Desktop.
PlistBuddyでInfo.plistのVersionやBuildを更新する ref: https://qiita.com/nomadmonad/items/717f1e3342315c9190ff
#!/bin/bash
PATH=/usr/libexec:$PATH
if [ $ACTION = "build" ]; then
exit 0
fi
buildNumber=$(PlistBuddy -c "Print CFBundleVersion" "${INFOPLIST_FILE}")
buildNumber=$(($buildNumber + 1))
PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${INFOPLIST_FILE}"
versionNumber=$(PlistBuddy -c "Print CFBundleShortVersionString" "${INFOPLIST_FILE}")
versionNumber=$(($versionNumber + 1))
PlistBuddy -c "Set :CFBundleShortVersionString $versionNumber" "${INFOPLIST_FILE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment