Xcode Management with Xcodes and Aria2

3 min read

Managing multiple Xcode versions can be a frustrating experience, especially when downloading from the Mac App Store. This guide introduces a powerful duo of open-source tools that will transform your Xcode management workflow: Xcodes and Aria2.

The Dynamic Duo

Think of Xcodes as Batman and Aria2 as Robin. Xcodes handles the heavy lifting of Xcode management, while Aria2 optimizes download speeds by utilizing system resources more efficiently. Together, they create a seamless experience for iOS developers.

Installation Guide

Prerequisites: Install Homebrew

If you haven’t already installed Homebrew, open Terminal and run:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Important: After installation, carefully read the terminal output. Apple Silicon users need to run two additional commands to complete the setup.

Installing Xcodes and Aria2

  1. Install Xcodes:

    brew install robotsandpencils/made/xcodes
    
  2. Install Aria2:

    brew install aria2
    
  3. Restart your terminal or open a new tab to ensure the tools are available in your PATH.

From this point forward, you’ll primarily interact with Xcodes while Aria2 works behind the scenes to accelerate downloads.

Using Xcodes

Viewing Available Versions

To see all available Xcode versions, run:

xcodes update

This displays a comprehensive list of all Xcode versions you can install, including release candidates and beta versions.

Installing Xcode

Xcodes offers flexible installation options:

  • Latest stable release:

    xcodes install --latest
    
  • Latest prerelease/beta:

    xcodes install --latest-prerelease
    
  • Specific version:

    xcodes install 13.2
    

The installation process provides clear progress updates:

(1/6) Downloading Xcode 13.2.0: 100%
(2/6) Unarchiving Xcode (This can take a while)
(3/6) Moving Xcode to /Applications/Xcode-13.2.0.app
(4/6) Moving Xcode archive to the Trash
(5/6) Checking security assessment and code signing
(6/6) Finishing installation

Managing Multiple Xcode Versions

Professional iOS development often requires maintaining multiple Xcode versions. Xcodes makes version switching effortless.

Switching Xcode Versions

Run the select command:

xcodes select

This displays all installed versions and allows you to choose the active one. The beauty of this approach is that it sets both the default Xcode and command-line tools versions simultaneously.

Opening Projects

After selecting your desired Xcode version, you can open projects using:

xed .

This command opens the current directory in the selected Xcode version.

Uninstalling Xcode Versions

Remove unnecessary Xcode versions to free up disk space:

xcodes uninstall 11.2

Benefits Over Traditional Methods

  1. Faster Downloads: Aria2’s multi-connection downloading significantly reduces download times
  2. Unified Management: Handle both Xcode and command-line tools from one interface
  3. Version Organization: Keep multiple versions organized with clear naming conventions
  4. Automation-Friendly: Perfect for CI/CD environments and automated setups

Pro Tips

  • Keep at least two Xcode versions: the latest stable release and either the previous version or latest beta
  • Use xcodes list to quickly view your installed versions
  • Set up aliases in your shell configuration for frequently used versions
  • Consider automating Xcode updates in your development environment setup scripts

Conclusion

Xcodes and Aria2 transform Xcode management from a tedious chore into a streamlined process. By leveraging these tools, you’ll spend less time wrestling with downloads and version management, and more time building great apps.

Give this setup a try, and you’ll wonder how you ever managed without it. The combination of faster downloads, easier version switching, and cleaner organization makes this the definitive solution for Xcode management on macOS.