Skip to content

How to uninstall the Xcode Command Line Tools on a Mac, and reinstall them

Remove the Command Line Tools with one command, why ours were 1.3 GB with SDKs for five macOS versions, and how to get a clean copy back.

4 min read

How do I uninstall the Command Line Tools on a Mac?

sudo rm -rf /Library/Developer/CommandLineTools

That is Apple's own advice: the tools live in one folder, and removing it removes them. git, make and Apple's python3 then ask to install the tools again when you run them.

Why are the Command Line Tools so big?

Updates add SDKs without removing old ones. Ours were 1.3 GB, and pkgutil --pkgs listed SDK packages for macOS 11, 12, 13 and 14 alongside the current one: four versions this Mac would never build for again.

How do I reinstall the Command Line Tools?

xcode-select --install

A fresh install holds only the current SDK. Then check with xcode-select -p, which should print /Library/Developer/CommandLineTools.

Will removing them break Homebrew?

Homebrew needs them to build packages, and asks you to reinstall them. Installed packages keep working; building new ones waits until the tools are back.

What the tools contain, and when you need the full Xcode: the Command Line Tools.

Common questions

How do I uninstall Xcode Command Line Tools?

Run sudo rm -rf /Library/Developer/CommandLineTools. Reinstall later with xcode-select --install.

Why are my Command Line Tools so large?

Updates add new SDKs without removing old ones. Ours held SDKs for four older macOS versions.

Read next