Main Tutorials

Git on macOS, xcrun: error: invalid active developer path

After upgrading to macOS Big Sur 11, macOS Monterey 12, macOS Ventura 13, etc. Does it seem every upgrading macOS will cause the following error message for the git command? How to fix it?

Terminal

% git

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

Solution

Open the Terminal, and run this

Terminal

    xcode-select --install  

The above command will install the command line developer tools.

Follow the GUI guide and proceed with the installation; this should fix the git xcrun error.

install command line developer tools

If the above is not working, try the below command.

Terminal

    sudo xcode-select --reset

References

About Author

author image
Founder of Mkyong.com, love Java and open source stuff. Follow him on Twitter. If you like my tutorials, consider make a donation to these charities.

Comments

Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments