Skip to content

Instantly share code, notes, and snippets.

@byaruhaf
Forked from hishma/updateBuildNumber.sh
Created September 26, 2020 07:02
Show Gist options
  • Save byaruhaf/1944bee9098d66b7d6da42156bfa3739 to your computer and use it in GitHub Desktop.
Save byaruhaf/1944bee9098d66b7d6da42156bfa3739 to your computer and use it in GitHub Desktop.
Shell script to update the build number (CFBundleVersion) of the info.plist in the build folder.
# Shamelessly ripped of from https://blog.curtisherbert.com/automated-xcode-build-numbers-early-2019-edition/
#
git=`sh /etc/profile; which git`
bundleVersion=`"$git" rev-list --all | wc -l | tr -d '[:space:]'`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $bundleVersion" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
echo "☛ BUILD NUMBER: ${bundleVersion}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment