Fixing the 'xcrun: error: invalid active developer path' on macOS

beginner🍎 macOS2026-04-04| macOS (Sequoia, Sonoma, Ventura, Monterey) after a system update or migration.

Error Message

xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
#xcrun#xcode#command-line-tools#macos#git

The Scenario: A Broken Terminal After Updating macOS

You just finished installing the latest macOS update. You open your terminal to get back to work, but the moment you type git status or make, your workflow hits a wall. Instead of the usual output, you get a cryptic error message about a missing path.

The Error Message

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

Major updates like the jump to macOS Sequoia (15.x) or Sonoma (14.x) often break the connection to the Command Line Tools (CLT). These tools are the backbone of your development environment. They provide essential utilities like gcc, git, and python3 without requiring the full Xcode suite.

Why Your Terminal is Refusing to Work

Updating the macOS kernel often invalidates the existing path to your developer tools. The xcrun utility acts as a traffic controller for your compilers. When it looks for tools at /Library/Developer/CommandLineTools and finds an empty directory or a version mismatch, it triggers this error. Essentially, the OS update cleaned up the system but forgot to relink your development binaries.

Solution 1: The Fast Reinstall (Recommended)

Most developers can fix this in under five minutes. You don't need to download the massive 12GB+ Xcode app from the App Store. Instead, you can trigger a lightweight installation (~700MB) directly from the terminal.

Run this command:

xcode-select --install

A software update dialog will pop up on your screen. Click Install and accept the license agreement. Depending on your internet speed, the download usually takes about 2 to 5 minutes. Once finished, your tools are immediately ready—no reboot required.

Solution 2: Pointing to the Full Xcode App

If you already have the full version of Xcode installed, the system might simply be looking in the wrong place. You can force macOS to use the tools bundled inside your Xcode application.

First, try resetting the path to the default location:

sudo xcode-select --reset

If that doesn't work, manually point it to your Xcode app directory:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Note: You will need to enter your Mac login password to authorize these sudo commands.

Solution 3: The "Nuclear Option" (When the Installer Fails)

Sometimes the xcode-select --install command insists that the software is "already installed," even though it's clearly broken. In this case, you need to manually delete the corrupted folder and start fresh.

1. Remove the old directory:

sudo rm -rf /Library/Developer/CommandLineTools

2. Run the install command again:

xcode-select --install

This forces the system to recognize that the tools are missing and prompts a clean download.

Verification: Is It Actually Fixed?

Don't just assume it worked. Run these three quick checks to ensure your environment is stable:

1. Check the active path:

xcode-select -p

You should see /Library/Developer/CommandLineTools as the output.

2. Test Git:

git --version

If it returns a version number (e.g., git version 2.39.5), you're back in business.

3. Verify xcrun:

xcrun --find git

This should point to the binary location, typically /usr/bin/git.

Summary

The "invalid active developer path" error is a standard hurdle after any macOS update. By running xcode-select --install, you bridge the gap between the new OS and your coding tools. Bookmark this command—you’ll likely need it again when the next version of macOS drops.

Related Error Notes