Skip to content
Home » How to Install the Xcode Command Line Tools on macOS

How to Install the Xcode Command Line Tools on macOS

Most command-line development on a Mac needs only the Xcode Command Line Tools — the compilers, git, and make, a few hundred megabytes — not the full multi-gigabyte Xcode IDE. Here’s how to install just the tools, check what you already have, and fix the “invalid active developer path” error that a macOS update sometimes leaves behind. Checked on macOS 26.5.2.

Command Line Tools vs full Xcode

These are two different downloads, and most people only need the smaller one. The Command Line Tools are the compilers and command-line utilities — clang, git, make, and the SDK headers — at a few hundred megabytes. Full Xcode is the complete IDE, 10+ GB from the App Store, and it’s only necessary if you’re building and shipping apps in Xcode itself. Running git, compiling something with make, or letting Homebrew build a formula from source all need just the Command Line Tools.

Install them

The direct way is one command, which opens a small system dialog — click Install and it downloads through Software Update:

xcode-select --install

There’s also an automatic path: the first time you run a command that needs them — git, clang, make — macOS pops the same dialog and offers to install the Command Line Tools for you. Either way you end up with the same thing.

Check what’s installed

xcode-select -p prints the active developer directory — /Library/Developer/CommandLineTools on a Command Line Tools install, or a path inside Xcode.app if full Xcode is installed and selected. To confirm the Command Line Tools package specifically, ask pkgutil:

$ pkgutil --pkg-info=com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 26.6.0.0.1781586589
volume: /
location: /

No output at all means the package isn’t installed. And xcode-select --version reports the tool’s own version, which is handy for confirming xcode-select itself is responding.

Fix “invalid active developer path”

After a macOS upgrade, everyday commands like git can suddenly fail with a version of this:

xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun ...

The upgrade left xcode-select pointing at a Command Line Tools directory the update had removed. Reinstalling them puts it back:

xcode-select --install

If the problem is a stale selection rather than a missing install — for example after deleting Xcode — reset the path to its default instead:

sudo xcode-select --reset

To point it somewhere specific rather than the default, use sudo xcode-select -s /Library/Developer/CommandLineTools.

The short version: xcode-select --install for the tools most projects actually need, xcode-select -p to see which developer directory is active, and a reinstall or --reset when an update breaks the path. The full Xcode IDE is a separate, much larger App Store download — covered in how to download and install Xcode — and it’s only necessary if you’re building apps in Xcode itself. All checked on macOS 26.5.2.

Leave a Reply

Your email address will not be published. Required fields are marked *