Created
February 16, 2023 06:14
-
-
Save dymx101/3b65e984be709e8aef43d1cea73ac913 to your computer and use it in GitHub Desktop.
Use Xcode 13.1 on macOS Ventura
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
Step 1: sudo xcode-select -s /Applications/Xcode-13.1.0.app | |
Step 2: open /Applications/Xcode-13.1.0.app/Contents/MacOS/Xcode | |
Extra Step (If step 2 not working, run the script below, then do step 2 again). | |
``` | |
#!/bin/bash | |
set -eux | |
readonly xcode13="/Applications/Xcode-13.1.0.app" | |
readonly xcode14="/Applications/Xcode-14.1.0.app" | |
# Backup Xcode 13 Info.plist | |
cp "${xcode13}/Contents/Info.plist" "${xcode13}/Contents/Info.plist.bak" | |
# Extract Xcode 14's CFBundleVersion | |
readonly xcode14_version=$(/usr/bin/plutil -extract "CFBundleVersion" raw "${xcode14}/Contents/Info.plist") | |
# Put Xcode 14's CFBundleVersion inside Xcode 13's Info.plist | |
/usr/bin/plutil -replace "CFBundleVersion" -string "${xcode14_version}" "${xcode13}/Contents/Info.plist" | |
# Open Xcode 13 so that the bundle is registered | |
open "${xcode13}" | |
# Sleep 5 seconds to let it start, kill it, and restore the original Info.plist | |
sleep 5 | |
pkill -f Xcode | |
mv "${xcode13}/Contents/Info.plist.bak" "${xcode13}/Contents/Info.plist" | |
# Reopen it in case lsd needs to refresh the CFBundleVersion | |
open "${xcode13}" | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
References:
https://developer.apple.com/forums/thread/707626
https://developer.apple.com/forums/thread/13629
https://blog.zen.ly/xcode-12-5-on-macos-monterey-23c257260316
https://gist.github.com/steeve/4e5d37ca9a07d4a796b909a6c9ae6156