This question was asked before, but unresolved here.
I have tried the solution here, but it doesn't solve the issue.
I get this error:
xcrun: error: active developer path ("/Applications/Xcode 2.app/Contents/Developer") does not exist, use xcode-select to change
The active developer path should NOT say "Xcode 2.app", but instead "Xcode.app".
My question is: How can I change the active path to say "Xcode.app"?
I already tried the following:
$> xcode-select -switch /Applications/Xcode.app/Contents/Developer
$> xcode-select -print-path
/Applications/Xcode.app/Contents/Developer
I have tried reinstalling Xcode, but the problem persists.
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.
In Finder, select the Go pull-down menu, and select Applications. Or just use the short-cut key Command-Shift-A while Finder is active. This should open a new Finder window, showing all the Applications installed on your machine. Look for the XCode icon in the Applications folder.
The whole point is that 'xcodebuild' requires Xcode, i.e., a full install of Xcode, nor CommandLineTools.
There is one more option without terminal, we can change active developer path through Xcode.
Launch Xcode, Go to Xcode -> Preferences -> Locations and in Command Line tools will list down all the installed Xcode list. From the drop down you can select any Xcode for active developer path.
Using this selection, you can set any Xcode (if you have multiple installed Xcode’s in your machine and you want change default one) set as a default active developer path.
Happy Coding :)
Have you tried to execute the switch command as root with a sudo command ?
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
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