Invalid active developer path error after upgrading to El Capitan

XcodeGit

Xcode Problem Overview


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

Xcode Solutions


Solution 1 - Xcode

This is all you need to do:

$ xcode-select --install

Solution 2 - Xcode

You can select command line tools from the XCode Preferences shown in the screenshot below.

You will get a prompt for password.

enter image description here

Solution 3 - Xcode

try typing in "xcode-select -print-path" and see if the path you see is the path you're expecting for your current Xcode version.

If you go to:

https://developer.apple.com/downloads/

(you'll need to sign in with your Apple Developer account)

Once there, you'll see links for "Command Line Tools". It sounds like you need to install MacOS 10.11 Command Line Tools for Xcode 7.

Solution 4 - Xcode

Try:

sudo xcode-select -r

in this way it unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism.

Solution 5 - Xcode

If you have Catalina and Xcode 11 and you have this problem, then go to Xcode Preferences and select Location tab, check that the Command Line tool dropdown has Xcode 11.0 selected. If Xcode 11 is not there then you need to download and install Command-line tools for Xcode 11 here (choose the correct Beta)

https://developer.apple.com/download/more/?=command%20line%20tools

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionjhnathView Question on Stackoverflow
Solution 1 - XcodeArcolyeView Answer on Stackoverflow
Solution 2 - Xcodenikhilgohil11View Answer on Stackoverflow
Solution 3 - XcodeMichael DautermannView Answer on Stackoverflow
Solution 4 - Xcoder4mView Answer on Stackoverflow
Solution 5 - XcodeHassan HusseinView Answer on Stackoverflow