On this page
Upgrading Xcode versions
Overview
It is common to need more than one Xcode version on the same Mac — for example, to keep building an app against a stable release while trying a new beta, to debug on an older iOS simulator runtime that a newer Xcode no longer ships, or to match the Xcode version used by a CI machine or a teammate. macOS supports having several Xcode.app bundles side by side, and the xcode-select tool decides which one the command-line developer tools (xcrun, xcodebuild, simctl, clang, etc.) use at any moment.
See Troubleshooting Xcode Issues for general “Xcode is in a bad state” recovery steps.
Install a second Xcode side by side
-
Sign in at developer.apple.com/download/all with your Apple Developer account and download the
.xip(or.dmgfor very old releases) for the Xcode version you want. The “More” / “All downloads” page is the canonical source for older and beta releases; the Mac App Store usually only offers the current stable version. The community-maintained xcodereleases.com catalog links directly to each Apple-hosted download if you need to find a specific build number. -
Double-click the
.xipto expand it into anXcode.appbundle next to the file. Do not open it yet.Note: The Xcode 27.3 beta 2 release notes say that Xcode is now available as an Apple Encrypted Archive (
.aea), that you extract it from the command line witharchiveutil extractXcodeAEA, and that Xcode 27.3 is the final release supporting the.xipformat. These are beta notes, and they don’t describe opening an.aeafrom Finder. If your download is an.aearather than a.xip, check the release notes for that Xcode version for current install steps. -
Rename the freshly extracted bundle to something descriptive before moving it into
/Applications(so it does not collide with the Xcode you already have). For example:mv ~/Downloads/Xcode.app ~/Downloads/Xcode-16.0.app sudo mv ~/Downloads/Xcode-16.0.app /Applications/ -
Launch the renamed app once from Finder so that macOS verifies it and Xcode installs its bundled components. Accept the license prompt if it appears.
You can repeat this for as many versions as you like. A common layout is Xcode.app (the version you use day-to-day) plus Xcode-beta.app and one or two pinned older releases (e.g. Xcode-15.4.app).
Switch which Xcode the command-line tools use
The xcode-select tool stores the path to one “active” developer directory that xcrun, xcodebuild, and friends consult.
# Inspect the active developer directory
xcode-select -p
# Point command-line tools at a specific Xcode
sudo xcode-select -s /Applications/Xcode-16.0.app/Contents/Developer
# Verify
xcodebuild -version
For a single command — handy in CI scripts or when you just want to build once with a non-default Xcode without changing the system-wide setting — set the DEVELOPER_DIR environment variable instead. It takes precedence over xcode-select for that invocation:
DEVELOPER_DIR=/Applications/Xcode-16.0.app/Contents/Developer xcodebuild -version
The Xcode GUI is independent of this setting — opening a .xcodeproj by double-clicking it launches whichever Xcode is associated with the file type (typically the most recently used one), regardless of what xcode-select points to.
After switching to a freshly installed Xcode, run its first-launch installer once so it can lay down required components:
sudo xcodebuild -runFirstLaunch
Install additional simulator runtimes
Since Xcode 15, simulator runtimes are installed separately from Xcode itself: you pick the platforms you need when you download Xcode or launch it for the first time, and you can add or remove runtimes later. Xcode 26 and later also download components such as simulator runtimes when they detect you need them. Older OS runtimes (iOS 17 simulators in Xcode 16, etc.) always have to be added yourself.
-
From the GUI: choose Xcode > Settings… (called Preferences on macOS 12 and earlier) and click Components in the sidebar (Xcode 16 and later; Xcode 15 called this pane Platforms). Click Get next to a component to install it. For a previously released runtime, click the Add Platforms button under Other Installed Platforms, select the versions you want, and click Download & Install.
-
From the command line,
xcodebuildcan download a runtime and install it:# Download the iOS 18.0 simulator runtime to ~/Downloads xcodebuild -downloadPlatform iOS -exportPath ~/Downloads -buildVersion 18.0 # Install a downloaded runtime .dmg into the Xcode that xcode-select points at # (replace the file name with the name of the .dmg you downloaded) xcodebuild -importPlatform ~/Downloads/Simulator-Runtime.dmgYou can also add a runtime
.dmgdownloaded from the same developer.apple.com/download/all page withxcrun simctl runtime add.xcrun simctl runtime listshows what is installed;xcrun simctl runtime delete <identifier>removes one.
Useful third-party tools
If you frequently swap between Xcode versions, the community-maintained xcodes CLI (and its companion Xcodes.app) automates the download / rename / install / select steps above and reads a .xcode-version file in a project root so different repositories can pin different toolchains. It still downloads from Apple’s servers and still requires an Apple Developer account.