How to fix "xcrun: error: invalid active developer path"
Researched, not yet tested: compiled from Apple's developer documentation and reports on Stack Overflow as of 29 November 2026; we couldn't run macOS in our test environment. Check the commands against your setup.
The Command Line Tools that git, make and Homebrew depend on are missing, usually after a macOS update. Reinstall them:
xcode-select --install
Click Install in the dialog, wait for it to finish and run your command again. We couldn’t test this on a Mac, so the steps below come from Apple’s command-line tools guide and what users report on Stack Overflow.
The full message
The error as reported in the top-voted Stack Overflow question about it:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
The path in brackets is the “active developer path” that xcode-select points to. The second half says the xcrun program isn’t there. Commands such as git in /usr/bin are small launchers that use xcrun to find the real tool, so they all fail the same way.
If xcode-select --install doesn’t fix it
| What happens | Fix |
|---|---|
xcode-select: error: command line tools are already installed |
The folder exists but is broken. Remove it with sudo rm -rf /Library/Developer/CommandLineTools, then run xcode-select --install again |
| The dialog says the software isn’t available | Download “Command Line Tools for Xcode” for your macOS from developer.apple.com/download/all and run the installer |
The path in the error is inside Xcode.app |
Xcode was moved or deleted. Reinstall it, or point to the standalone tools with sudo xcode-select --switch /Library/Developer/CommandLineTools |
| It works in Terminal but not in an app or IDE | Quit and reopen the app so it picks up the new tools |
The remove-and-reinstall step is the uninstall command from Apple’s guide. Check the path before you press Return, because sudo rm -rf deletes without asking.
Check it worked
xcode-select -p
git --version
xcode-select -p should print /Library/Developer/CommandLineTools (or your Xcode path), and git --version should print a version instead of the xcrun error. If you use Homebrew, run brew doctor too. Its macOS checks include warnings such as “A newer Command Line Tools release is available.” and “Your Command Line Tools are too outdated.”
This error comes back after many macOS upgrades. Our guide to the Xcode Command Line Tools covers updating them with softwareupdate, checking the installed version and when you need the full Xcode instead.
FAQ
Why did git stop working after a macOS update?
On a Mac without Xcode, git comes from Apple's Command Line Tools. A macOS update can remove or invalidate them, so the git launcher in /usr/bin can't find the real program and prints the xcrun error. Reinstalling the tools brings it back.
Do I need to install the full Xcode to fix this?
No. The Command Line Tools package is enough for git, Homebrew and compilers. Install the full Xcode only if you build apps for Apple platforms.
Will reinstalling the Command Line Tools delete my repositories or Homebrew packages?
No. The tools live in /Library/Developer/CommandLineTools, separate from your projects and from Homebrew's folder. Your code, git history and installed packages stay where they are.
