Created
December 23, 2022 18:54
-
-
Save einsteinx2/0f3adfe0012992f7fb5a50fba8e0ec56 to your computer and use it in GitHub Desktop.
Fix old Xcode to run on new macOS
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
#!/bin/sh | |
# https://stackoverflow.com/a/74500488/299262 | |
set -euo pipefail | |
# Set the paths to your Old/New Xcodes | |
OLD_XCODE="/Applications/Xcode-13.4.1.app" | |
NEW_XCODE="/Applications/Xcode.app" # To get build number | |
# Get New Xcode build number | |
OLD_XCODE_BUILD=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${OLD_XCODE}/Contents/Info.plist) | |
NEW_XCODE_BUILD=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" ${NEW_XCODE}/Contents/Info.plist) | |
echo The Old Xcode build version is $OLD_XCODE_BUILD | |
echo The New Xcode build version is $NEW_XCODE_BUILD | |
# Change Old Xcode build version to New Xcode | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${NEW_XCODE_BUILD}" ${OLD_XCODE}/Contents/Info.plist | |
# Open Old Xcode (system will check build version and cache it) | |
open $OLD_XCODE | |
# Revert Old's Xcode's build version | |
/usr/libexec/PlistBuddy -c "Set :CFBundleVersion ${OLD_XCODE_BUILD}" ${OLD_XCODE}/Contents/Info.plist |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment