Last active
December 20, 2015 12:00
-
-
Save huacnlee/6128098 to your computer and use it in GitHub Desktop.
Xcode 编译的时候自动修改 App 的 Build 为 Git 的 commit 次数,同时根据不同的 Build 模式,给 build 号加特别的后缀
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GIT=/usr/bin/git | |
INFO_PLIST=$BUILT_PRODUCTS_DIR/$WRAPPER_NAME/Contents/Info.plist | |
BUILD_SUFIX="" | |
if [ $CONFIGURATION == Debug ] | |
then | |
BUILD_SUFIX="D" | |
fi | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion `$GIT rev-list HEAD --count`$BUILD_SUFIX" "$INFO_PLIST" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment