Invalid active developer path: Xcode Command Line Tools broken after an update

After this, git, make, and clang work from any Terminal tab again.

M1M2M3M4 · macOS 14–26 · Verified 2026-09-07
On this page
Quick answer

A major macOS update sometimes leaves the Command Line Tools pointed at a path that no longer resolves correctly, so git, make, and anything that shells out to clang fail with an "invalid active developer path" error. Confirm the path, then reinstall or reset it — this doesn't touch your projects or Xcode itself.

Why this happens

The Command Line Tools are a separate package from Xcode, installed either standalone or alongside it, and xcode-select just points the system at whichever one should be active. A macOS or Xcode update can move or invalidate that target without updating the pointer, so every tool that depends on it — git included, since macOS ships it as a Command Line Tools shim rather than a real standalone binary — fails immediately with a developer-path error until the pointer is fixed.

Fix it

  1. Confirm what's currently set as the active developer path:

    Reads the system

    What it does: prints the path xcode-select currently points at.

    After: nothing changes, this only reads.

    xcode-select -p

    Output — healthy (captured live)

    /Library/Developer/CommandLineTools

    Output — broken (representative, not from this machine)

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

    The first block is the real path on the verification machine, shown so you know what a working answer looks like. The second is the well-documented error text for the broken case — reproducing it live would mean deliberately breaking the tools on the machine this article was verified on, which isn't a trade worth making for a screenshot.

  2. If the path is broken or missing, reinstall the tools. This opens the standard Apple installer dialog and only adds files — it doesn't remove or reset any of your projects, shell config, or Xcode itself:

    Changes settings

    What it does: triggers a fresh install of the Command Line Tools package.

    After: a system dialog opens; once it finishes, xcode-select -p resolves again.

    sudo xcode-select --install

    Revert: not needed — this only adds missing files, it doesn't remove anything to undo.

    On a slow or locked-down network, the popup installer can fail to reach Apple's servers. If it does, download the package directly from developer.apple.com/download/all/ (free Apple ID required, search "Command Line Tools") and run the .pkg by hand instead.

  3. If step 2 instead prints xcode-select: error: command line tools are already installed, use "Software Update" to install updates — the dialog won't appear, but the path is still broken — the folder exists but is corrupt. Remove it first, then reinstall:

    Irreversible

    What it does: deletes the entire Command Line Tools folder.

    After: run sudo xcode-select --install again immediately afterward — the machine has no working CLT until you do.

    This only removes the CLT package itself, not your projects or any file you created — there's nothing personal to back up here. It's marked irreversible only because there's no single "undo" command; the undo is reinstalling in the next step.

    sudo rm -rf /Library/Developer/CommandLineTools

    Revert: sudo xcode-select --install immediately after.

  4. If the path resolves fine and neither error above showed up, reset the pointer to the default location instead — this covers the case where CLT is genuinely installed but something switched the active target (an Xcode beta you later removed is the most common cause):

    Changes settings

    What it does: resets the active developer directory to the default Command Line Tools path.

    After: takes effect immediately, no reboot needed.

    sudo xcode-select --reset

    Revert: sudo xcode-select -s /Applications/Xcode.app/Contents/Developer if you specifically need it pointed at a full Xcode install instead.

Still broken?

Before concluding it's still CLT, rule out a different Apple-Silicon-specific trap: Homebrew installs to /opt/homebrew on Apple Silicon (versus /usr/local on Intel), but Xcode's own Run Script build phase only includes /usr/local/bin in its PATH by default — so a Homebrew-installed tool "disappearing" mid-build looks exactly like a broken toolchain but is actually a PATH problem specific to this chip generation. Verify what's actually installed, independent of the path pointer:

Reads the system

What it does: confirms the CLT package receipt is registered with the system installer database.

After: nothing changes, this only reads.

pkgutil --pkgs | grep CLTools

Expect com.apple.pkg.CLTools_Executables. One caveat worth knowing: after some macOS upgrades this receipt goes missing even though the tools are installed and working fine — treat a blank result here as inconclusive, not proof of a problem, and trust xcode-select -p and a real git command over this check alone.

Verified on

ChipmacOSVerified
M1 (MacBook Air)26.62026-03-02
M2 Pro (Mac mini)26.62026-05-03
M3 (MacBook Pro)26.6.22026-09-07
M4 (MacBook Pro)26.62026-07-08

The healthy xcode-select -p output above was captured live on the M3 / macOS 26.6 row.

Related problems