29

I have installed macOS Ventura – the latest version of macOS – and I would like to have a stable version of Xcode (e.g. 13.4.1) running. However, it says "The version of Xcode installed on this Mac is not compatible with macOS Ventura."

Is there any way to run Xcode on Ventura?

Screenshot of error popup

Adil Hussain
  • 30,049
  • 21
  • 112
  • 147
Hassan
  • 1,106
  • 1
  • 4
  • 16

3 Answers3

55

Xcode 14 is required by macOS Ventura. But if, in case you want to use your old version of Xcode (e.g Xcode 13), you can launch it directly from the finder or from the terminal.

To open in finder navigate to:

Applications Folder > Find Xcode App > Right click on the app and click on Show Package Contents > Open Contents > Open MacOS > and launch Xcode.

Or

Run the following command in the terminal:

open /Applications/Xcode.app/Contents/MacOS/Xcode.

Hassan
  • 1,106
  • 1
  • 4
  • 16
  • 3
    If using command lines you get the error: `The application cannot be opened for an unexpected reason, error=Error Domain=NSOSStatusErrorDomain Code=-10664 "kLSIncompatibleApplicationVersionErr: The app is incompatible with the current OS" UserInfo={_LSLine=4087, _LSFunction=_LSOpenStuffCallLocal}` just kill the command and try again, it should work ! – MoOx Oct 25 '22 at 14:26
  • 3
    Also, you may need to set the command line tools with `xcode-select -s ` because Xcode > Preferences > Location won't show options to downgrade it in UI. – henrique Oct 27 '22 at 10:56
  • 1
    Download the older Xcode versions from [link](https://developer.apple.com/download/all/?q=Xcode) and apply the above steps on the XCode zip file in the Downloads folder on mac. – Pravalika Nov 05 '22 at 18:55
  • But you can't export app. – Abhishek Thapliyal Nov 08 '22 at 08:02
  • Can we open it in Rosetta mode? I don't find Rosetta mode. – Jayeshkumar Sojitra Nov 09 '22 at 09:54
  • @JayeshkumarSojitra you can follow [this thread](https://developer.apple.com/forums/thread/718722) it might help. – Hassan Nov 10 '22 at 11:19
  • This worked for me but in my case I had installed Ventura to find out that the latest xcode didn't work, downloaded and extracted the 13.4.1 version after having to remove 14 because it didn't work with Visual Studio. So my xcode was extracted in downloads and I was able to open from there. Thanks! – Mike Dec 26 '22 at 01:13
  • Case note: we upgraded the OS on a machine but did not yet put xcode 14 on it. Running the existing xcode 13.4.1 from the UI failed as expected, running from command line showed the IDE, but builds failed in strange ways with no clear information why. So I don't consider this a good answer. Zapping the build number with the scripted approach allowed things to run and build successfully. – Rick Berge May 24 '23 at 21:32
17

Single-run script to fix the problem

As this problem in principle is the same problem as last year, when we wanted to run Xcode 12 on macOS Monterey, it is worth to check last year's question on the same problem. There, I found this great answer in which a script is proposed that only needs to be run once to fix the problem (allowing a regular opening of Xcode 13, e. g. via double click). The script works by changing the build version of the old Xcode 13 to the build version of the new Xcode 14, thereby tricking the OS.

Before running the script, you need to change the OLD_XCODE and NEW_XCODE variables to the correct path.

#!/bin/sh

set -euo pipefail

# Set the paths to your Old/New Xcodes
OLD_XCODE="/Applications/Xcode-13.4.1.app"
NEW_XCODE="/Applications/Xcode-14.1.0.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
johndpope
  • 5,035
  • 2
  • 41
  • 43
fredpi
  • 8,414
  • 5
  • 41
  • 61
5

For my future self, when I prematurely upgrade my macOS to the latest version.

Since I'm using Xcode just for a building purposes for my Flutter app and I don't really care about Xcode UI, all I needed to do is:

  1. Download the desired xcode version app from https://xcodereleases.com
  2. Unzip the app and rename it to Xcode-<version>.app
  3. Move it to /Applications directory
  4. Run xcode-select command: xcode-select -s /Applications/Xcode-<version>.app
  5. Confirm that the correct Xcode version is selected with xcode-select -p
  6. That's it.

That way I can have multiple Xcode app versions and I can quickly switch between them.

matox
  • 885
  • 11
  • 27
  • I had to use "sudo" BTW, still, how do I start the selected version? it still shows the current updated version on ventura M1. – Code Drop Aug 31 '23 at 11:18