Xcode – xcrun: error: active developer path (“/Applications/Xcode.app/Contents/Developer”) does not exist

pathxcodexcrun

I'm having xcode issues when I try to use brew and git:

xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist, use xcode-select --switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or see man xcode-select)

I can type xcode-select and it shows that the command exists. When I type xcode-select -p it shows:

/Applications/Xcode.app/Contents/Developer

but when I do which xcode-select, it gives me:

/usr/bin/xcode-select

I've tried to use the command switch and install again via Apple Developer site but none of these options have work so far… How can I fix this?

Best Answer

I tried that and it didn't work but I found the answer. I just had to reset the developer's path:

$ sudo xcode-select --reset

Now everything is normal