Created
February 20, 2026 07:20
-
-
Save yannxou/c21f1e434f996b5944765078feec61ea to your computer and use it in GitHub Desktop.
Use Git Commit Count as Build Number in xcode
This file contains hidden or 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
| # Add this to a target's build phases -> New run script phase | |
| # Use Git Commit Count as Build Number | |
| BUILD_NUMBER=$(git rev-list --count HEAD) | |
| echo "Build number: $BUILD_NUMBER" | |
| /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $BUILD_NUMBER" \ | |
| "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment