Skip to content

Instantly share code, notes, and snippets.

@kmonaghan
Created May 30, 2012 21:10
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kmonaghan/2838992 to your computer and use it in GitHub Desktop.
Save kmonaghan/2838992 to your computer and use it in GitHub Desktop.
Example script to update Bundle version using svn version number before archiving an iOS project in Xcode. See http://www.karlmonaghan.com/2012/05/30/auto-versioning-and-auto-uploading-to-testflighthockeyapp-when-archiving-in-xcode/ for more information.
SVN=`which svnversion`
REV=`${SVN} -nc ${SOURCE_ROOT} | /usr/bin/sed -e 's/^[^:]*://;s/[A-Za-z]//'`
BASEVERNUM=`/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" "${SOURCE_ROOT}"/"${INFOPLIST_FILE}"`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BASEVERNUM.$REV" "${SOURCE_ROOT}"/"${INFOPLIST_FILE}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment