How to install, update and fix the Xcode Command Line Tools

Researched, not yet tested: compiled from Apple's developer documentation and Homebrew's docs as of 29 November 2026; we couldn't run macOS in our test environment. Check the commands against your setup.

The Command Line Tools give you git, clang, make and the other developer commands without the full Xcode app. Install them from Terminal:

xcode-select --install

A dialog opens. Click Install, accept the licence and click Done when it finishes. Then check:

xcode-select -p
git --version

We couldn’t run macOS in our test environment, so this page is researched from Apple’s guide to installing the command-line tools and Homebrew’s documentation, not tested on a Mac. Apple’s guide shows the Terminal reply as xcode-select: note: install requested for command line developer tools.

What’s in the package

Apple’s documentation says the package has the same macOS SDK, man pages and toolchain binaries that ship with Xcode, and installs them in /Library/Developer/CommandLineTools. The commands themselves are in /Library/Developer/CommandLineTools/usr/bin.

You need Command Line Tools Full Xcode
Homebrew, git, compiling C or C++ code, Python or Ruby gems with native extensions Yes Also works
Building iOS, watchOS or visionOS apps, the Simulator, Interface Builder No Yes
xcodebuild and xctrace No (Apple says these ship only with Xcode) Yes

Homebrew’s installation requirements list the Command Line Tools or Xcode, and its installer offers to install the tools if they’re missing.

Other ways to install

  • Run any developer command. On a fresh Mac, Apple notes that running a command from the package, such as git, brings up the same install prompt.
  • Download the installer. Apple lists every version on developer.apple.com/download/all (Apple Account sign-in required). Search for “Command Line Tools for Xcode” and pick the one that matches your macOS. This helps when the dialog says the software isn’t available, or you need an older version.

You can only have one version of the package installed at a time.

Check the version

pkgutil --pkg-info=com.apple.pkg.CLTools_Executables

Apple’s example output includes a version: line, such as version: 26.1.0.0.1.1760670222 for the Command Line Tools for Xcode 26.1 beta. xcode-select -p shows which developer folder your commands use: /Library/Developer/CommandLineTools for the standalone tools, or a path inside Xcode.app if Xcode is selected.

Update the Command Line Tools

xcode-select --install doesn’t update. If the tools are already there it stops with xcode-select: error: command line tools are already installed, use "Software Update" to install updates (the message users report in a Stack Overflow thread on updating). Update through Software Update in System Settings, or from Terminal:

softwareupdate --list
softwareupdate --install "<label from the list>"

Copy the label of the “Command Line Tools” entry exactly as --list prints it. Apple recommends checking for a new release after every macOS upgrade, because the installed version may not work with the new macOS.

Fix the Command Line Tools after a macOS update

After a macOS upgrade, git or brew can fail with:

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

The upgrade removed or broke the tools. Run xcode-select --install again. Our page on the invalid active developer path error covers this one in full.

If a reinstall doesn’t take, or Software Update offers nothing, do a clean reinstall:

sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

That rm command is the uninstall step in Apple’s guide. Check the path before you press Return, because sudo rm -rf deletes without asking.

If you have Xcode and the tools are confused

If you installed Xcode and later removed it, or moved it, commands can point at a folder that no longer exists. Point them back at the standalone tools:

sudo xcode-select --switch /Library/Developer/CommandLineTools

Or reset to the default choice with sudo xcode-select --reset. Both options are in man xcode-select on any Mac.

Uninstall

Apple’s guide gives two commands. The first removes the tools. The second deletes the package receipt so Software Update stops offering new versions:

sudo rm -rf /Library/Developer/CommandLineTools
sudo pkgutil --forget com.apple.dt.commandlinetools

Homebrew and git stop working until you reinstall. With the tools in place, install Homebrew next.

FAQ

What are the Xcode Command Line Tools?

A free Apple package with the compilers and developer commands that ship inside Xcode (such as clang, xcrun, git and make), plus the macOS SDK and man pages, without the Xcode app itself. Homebrew and most developer tools on a Mac need it.

Do I need the Command Line Tools if I have Xcode?

No. Apple's documentation says Xcode already bundles the tools, so you don't need to install them separately. Some developers install both. In that case xcode-select -p shows which one your commands use.

Should I install the Command Line Tools on my Mac?

Yes, if you use Terminal for development: Homebrew, git, Python packages that compile code and most language toolchains depend on them. If you only use apps, you don't need them.

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

There's no app to open. The tools are commands you run in Terminal, such as git --version or clang --version. They live in /Library/Developer/CommandLineTools/usr/bin.

Why does xcode-select --install say the tools are already installed?

The tools are installed and --install only handles first installs. To update them, use Software Update in System Settings or softwareupdate --list in Terminal. To reinstall from scratch, remove /Library/Developer/CommandLineTools first.