If you’ve upgraded your macOS to its latest version and then attempted to run
git commands, you’ve likely received the following error:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: invalid active developer path occurs when you haven’t agreed to the licensing agreement for the Xcode Command Line Tools after an update.
Invalid Active Developer Path in Git Solved
“Invalid active developer path” is a common error that occurs when you haven’t agreed to the Xcode Command Line Tools licensing agreement after a macOS update. To solve the issue, install the Command Line Tools package using the command:
In the following sections we’ll quickly go through the main cause for this error and a simple, yet effective solution so that you can then start doing (Git) business as usual.
What Causes the Invalid Active Developer Path Error?
The main reason for the invalid active developer path error after a major macOS upgrade is that you haven’t agreed to the license agreement for Xcode Command Line Tools.
But that’s not the only reason. It’s important to mention that
git itself doesn’t specify whether the error is coming from your local machine or the remote host. There’s a chance that you may see this error when interacting with the remote host, such as on
git pull, but not when interacting with your local host, such as
git status. You may need to run the suggested solution outlined in the next section either on your local or remote hosts (or both).
How to Solve the Invalid Active Developer Error
To solve this problem, all you need to do is install the Command Line Tools package using the following command:
The Command Line Tools Package is a self-contained package that’s downloaded separate from Xcode. The package enables command line development in macOS and includes the macOS SDK and Command Line Tools like Clang that are installed in the
/Library/Developer/CommandLineTools directory, according to Apple’s technical notes. There’s no need to install XCode since it’s a huge installation. All you need is the Command Line Tools, which are just a few hundreds of megabytes.
Now, if the above command doesn’t do the trick for you, then there’s a chance that you will also need to run the following command:
sudo xcode-select --reset
error: invalid active developer path is one of the most common errors that developers see while trying to run
git commands after upgrading their machines to the latest OS X/macOS. Rest assured, this is not your fault. You just need to run the Command Line Tool installation command, and you should be good to go.