Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change active Developer Path for Xcode

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.

like image 251
MatrixMummy Avatar asked Mar 27 '14 06:03

MatrixMummy


People also ask

How do I change the developer path on a Mac?

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.

How do I find Xcode path on Mac?

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.

Does Xcodebuild require Xcode?

The whole point is that 'xcodebuild' requires Xcode, i.e., a full install of Xcode, nor CommandLineTools.


2 Answers

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 :)

like image 78
Prn2698 Avatar answered Sep 17 '22 14:09

Prn2698


Have you tried to execute the switch command as root with a sudo command ?

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
like image 32
Xavier KRESS Avatar answered Sep 17 '22 14:09

Xavier KRESS