I ran into this error trying to push to git, when I typed git init.
xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
I tried the following solutions.
xcode-select —install sudo xcode-select -switch sudo xcode-select —install brew doctor brew update brew upgrade brew cleanup
Conclusion. The xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) error is raised when you try to run a git command without having Xcode Tools installed. To fix this error, run xcode-select –install and install Xcode Tools.
The problem is that one needs to explicitly agree to the license agreement. As a follow on step, you may need to reset the path to Xcode if you have several versions or want the command line tools to run without Xcode. I found the solution in this question, Command Line Tools not working.
Use xcode-select -switch to choose which version of Xcode you're using by default. On OSX Yosemite use xcode-select --switch path/to/Xcode.
xcrun is a tool that helps managing Xcode versions on your system. It allows you to write scripts that don't need to know where your Xcode instance or developer tools are installed. The path to the Xcode version (or developer tools) is set/read via xcode-select . You can reset it via: sudo xcode-select --reset.
This is all you need to do:
$ xcode-select --install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With