How to Fix “xcrun: error: invalid active developer path” after upgrading macOS
After every major macOS update (including the recent macOS Tahoe), many people open Terminal and try to use git or any other command-line tool, only to see this error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
The upgrade removes or breaks the link to Apple’s Command Line Tools. Here is the simple fix.
Main Solution (Works in 99 % of Cases)
- Open Terminal.
- Run this command:
xcode-select --install
- A window will appear asking you to install the Command Line Tools. Click “Install” and wait.
(The window can hide behind other windows, so check your Dock or use Command+Tab if nothing seems to happen.)
You do not need to install the full Xcode application (which is many gigabytes). This option installs only the Command Line Tools.
If the Problem Persists
Run this second command:
sudo xcode-select --reset
Enter your password when asked. This resets the developer tool path and almost always solves any remaining issues.
Optional: Point the Tools to a Specific Location
- If you have the full Xcode.app installed and want to use its tools:
sudo xcode-select --switch /Applications/Xcode.app
- If you only want the standalone Command Line Tools (the usual choice):
sudo xcode-select --switch /Library/Developer/CommandLineTools
Rare Error: “Can’t install the software because it is not currently available…”
A few users see this message when running xcode-select --install. In that case, just run the reset command:
sudo xcode-select --reset
and the problem normally disappears without needing to download anything again.
That is it. After these steps, git, make, gcc, and all other command-line developer tools work again immediately. No restart required.
Category:
Tags:
Year: