Skip to content

Instantly share code, notes, and snippets.

@agassiyzh
Created March 30, 2012 10:20
Show Gist options
  • Save agassiyzh/2250618 to your computer and use it in GitHub Desktop.
Save agassiyzh/2250618 to your computer and use it in GitHub Desktop.
xcode在编译时带上git版本信息
git_version=`git rev-parse --short HEAD`
app_version=`git describe --tags`
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion $app_version" $PRODUCT_SETTINGS_PATH
/usr/libexec/PlistBuddy -c "Set :CFBundleShortVersionString $git_version" $PRODUCT_SETTINGS_PATH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment