Created
May 7, 2021 06:00
-
-
Save jimmyhoran/3487914200a16bb87b0c9bd665832f48 to your computer and use it in GitHub Desktop.
Scripts to bump iOS app versions components and build number
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
#!/usr/bin/env bash | |
# | |
# bump-ios-app-version | |
# Usage example: ./bump-ios-app-version minor apps/app-ios-parking/SupportingFiles/Info.plist | |
component=$1 | |
info_plist_path=$2 | |
version=$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' ${info_plist_path}) | |
IFS="." read major minor <<< "$version" | |
echo "Current version: $version" | |
if [[ "$component" = 'major' ]]; then | |
major=$((major + 1)) | |
minor=0 | |
elif [[ "$component" = 'minor' ]]; then | |
minor=$((minor + 1)) | |
fi | |
version="${major}.${minor}" | |
echo "New version: $version" | |
/usr/libexec/PlistBuddy -c "Set CFBundleShortVersionString ${version}" $info_plist_path |
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
#!/usr/bin/env bash | |
# | |
# bump-ios-build-number | |
# Usage example: ./bump-ios-build-number apps/app-ios-parking/SupportingFiles/Info.plist | |
info_plist_path=$1 | |
build_number=$(/usr/libexec/PlistBuddy -c 'Print CFBundleVersion' ${info_plist_path}) | |
echo "Current build number: $build_number" | |
build_number=$((build_number + 1)) | |
echo "New build number: $build_number" | |
/usr/libexec/PlistBuddy -c "Set CFBundleVersion ${build_number}" $info_plist_path |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment