How to Switch from Xcode to Command Line Tools for Xcode

, Wellesley, MA

The complete Xcode package is around 4 GB, and there are no incremental upgrades. You download 4 GB for every upgrade. There’s a much smaller option if all you want to do is build and install Homebrew packages from source: Command Line Tools for Xcode is around 140 MB. A big thanks to Kenneth Reitz for proving this was possible, and to Apple for building on Kenneth’s work and providing official packages.

Uninstall Xcode.

sudo /Developer/Library/uninstall-devtools --mode=all
sudo rm -rf /Developer

Download Command Line Tools for Xcode.

Sign in with your Apple ID to get access.

Install Command Line Tools for Xcode.

Configure your system to find the tools.

sudo xcode-select -switch /usr/bin

Update Homebrew.

brew update

Before upgrading, I had Python 2.6 installed from python.org. Installing Python-dependent Homebrew packages with Python 2.6 installed failed when it tried to use the Mac OS 10.4 SDK. I removed that Python 2.6 from my PATH, and reinstalled Python using Homebrew.

brew install python

Add /usr/local/share/python to the beginning of PATH.

Upgrade Homebrew packages.

brew upgrade

When I upgraded, Homebrew said that it couldn’t link many packages from /usr/local. I’m not sure why, but I linked them all myself.

for p in `brew list` ; do brew link $p ; done

Enjoyed reading this post? Discuss it on Reddit, or follow me on Twitter.