Skip to content

Instantly share code, notes, and snippets.

@MTattin
Created July 2, 2016 02:02
Show Gist options
  • Save MTattin/f75ece14362263fdf314a0c784ff7f48 to your computer and use it in GitHub Desktop.
Save MTattin/f75ece14362263fdf314a0c784ff7f48 to your computer and use it in GitHub Desktop.
CFBundleVersionをReleaseビルドの時だけ更新 ref: http://qiita.com/MTattin/items/159e09e859f797429f9f
if [[ ${CONFIGURATION} == "Release" ]]; then
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PRODUCT_SETTINGS_PATH}")
buildNumber=$(($buildNumber + 1))
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "${PRODUCT_SETTINGS_PATH}"
echo "[UpdateBuildNumber Release] CFBundleVersion Increment ${buildNumber}"
else
buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "${PRODUCT_SETTINGS_PATH}")
echo "[UpdateBuildNumber Debug] CFBundleVersion Not Increment ${buildNumber}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment