← Back to archive

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 seed or xcodes install --latest-prerelease.
  • Install from a local .xip archive: 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 arm64 or --architecture universal, which is useful on Apple Silicon machines.
  • Pin a project or CI environment to a specific Xcode with a .xcode-version file containing something like 13.4.1.
  • Speed up downloads and unarchiving: the README states that if aria2 is installed, downloads use up to 16 connections and run 3–5x faster than URLSession, and the experimental --experimental-unxip flag (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:

  1. xcodes list to see available versions, optionally filtered with --architecture.
  2. xcodes install 13.4.1 and authenticate when prompted, or set XCODES_USERNAME and XCODES_PASSWORD for non-interactive use, including CI.
  3. xcodes select 13.4.1 to switch the active toolchain, or commit a .xcode-version file so teammates and CI align automatically.
  4. xcodes runtimes install "iOS 17.0-beta1" to add a simulator runtime, and xcodes 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.