Running newest Xcode on older macOS version
Tags: swift, ios, tips and tricks
Every year, Apple releases a new macOS version, and a new version of Xcode. Seemingly these are tied together, and you cannot use the lastest version of Xcode, without first upgrading to the latest macOS version.
After spending a good hour with downloading and extracting the latest Xcode version, if you try to run it, you will be greated with the following annoying dialog:
I’m personally usually not very fond of upgrading to the latest macOS version ever since the horrible change to notifications, so I try to delay it until it’s absolutely necessary.
Luckily, this alert is a big ass lie. You can verify this by right-clicking the Xcode.app
-> Show Package Contents
, and running the binary Contents/MacOS/Xcode
. All of a sudden, Xcode will run no problem. WTF?
Workaround
The alert is shown based on the LSMinimumSystemVersion
in the Info.plist
file that comes inside Xcode.app
. If you open this file, you will see Minimum system version
with a value of 13.5
in case of Xcode 15.
All we need to do to get it to run is to simply modify this value.
- Copy the
Info.plist
file to your Desktop- For safety reasons, create another copy called
Info-backup.plist
just in case you make a mistake
- For safety reasons, create another copy called
- Open it with Xcode
- If you don’t have a running version of Xcode installed, refer to Modifying Info.plist without Xcode
- Modify the
Minimum system version
to be equal or lower than your current macOS version- You can find your current macOS version under
-> About This Mac
- You can find your current macOS version under
- Save the file
- Copy the modified
Info.plist
back toXcode.app/Content/Info.plist
and override the existing one
At this point, if you try to run Xcode.app
, you might still get the alert. This is because Launch Services keeps an internal cache. Run the following command to purge it:
|
|
Voilà, Xcode is working!
Keep in mind, you will need to repeat the same steps the Simulator
app as well. You can find it under Xcode.app/Contents/Developer/Applications/Simulator.app
. Then another Show package content
, and modify the Info.plist
as you did before.
Modifying Info.plist without Xcode
The bundled Info.plist
file has a Binary format, therefore modifying it with existing text editors is quite difficult.
You can convert it to XML, by running:
|
|
You can then look for the key LSMinimumSystemVersion
, modify the associated string value, saving the changes, and finally converting it back to binary, by running:
|
|
You can then copy and override the original file located at Xcode.app/Contents/Info.plist
.
Conclusion
You have seen how you can run Xcode in an older macOS version than originally intended.
If you encounter any issues that I did not cover, or you would like to give feedback, feel free to get in touch at moc.htikmsofi@gomlb!