Repo of the Day
XcodesOrg/xcodes
Published: Dec 14, 2022
Open repository ↗The best command-line tool to install and switch between multiple versions of Xcode.
Summary
xcodes is a Swift command-line tool for macOS that installs, switches between, and manages multiple versions of Xcode. It automates the download, unxip, code-signing, and placement of Xcode releases, and it can also install simulator runtimes such as iOS 17.0-beta1. Authentication uses an Apple ID, with the password stored in the system keychain for reuse.
What it is useful for
xcodes addresses the tedious parts of juggling Xcode across projects, CI, and team machines. It is useful when you need to:
- Install a specific Xcode version by name, including prereleases and GMs:
xcodes install 11.2 GM seedorxcodes install --latest-prerelease. - Install from a local
.xiparchive:xcodes install 9.0 --path ~/Archive/Xcode_9.xip. - Switch the active Xcode with
xcodes select, list available or installed versions, and uninstall old ones, all from the terminal. - Filter the available list by architecture, e.g.
xcodes list --architecture arm64or--architecture universal, which is useful on Apple Silicon machines. - Pin a project or CI environment to a specific Xcode with a
.xcode-versionfile containing something like13.4.1. - Speed up downloads and unarchiving: the README states that if
aria2is installed, downloads use up to 16 connections and run 3–5x faster than URLSession, and the experimental--experimental-unxipflag (based on saagarjha/unxip) is reported to unxip up to 70% faster.
How engineers can use it
The documented install path is Homebrew, which the README flags as preferred and notes that the builds are Developer ID-signed and notarized, so they work without an existing Xcode:
brew install xcodesorg/made/xcodes
Alternatives documented in the README are mint install XcodesOrg/xcodes or building from source with make install (which itself requires Xcode 12.0 or later, so it is not suitable for bootstrapping a fresh machine).
Typical workflow after install:
xcodes listto see available versions, optionally filtered with--architecture.xcodes install 13.4.1and authenticate when prompted, or setXCODES_USERNAMEandXCODES_PASSWORDfor non-interactive use, including CI.xcodes select 13.4.1to switch the active toolchain, or commit a.xcode-versionfile so teammates and CI align automatically.xcodes runtimes install "iOS 17.0-beta1"to add a simulator runtime, andxcodes uninstall <version>to clean up.
A documented limitation: building from source requires Xcode 12.0 or later, so the Homebrew or Mint route is the only practical option on a machine with no Xcode installed. Full shell-completion instructions and per-shell details are linked from the README.