Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode-select -switch path when using cli toolkit

With the release of Apple's Command Line Toolkit for Xcode, I am trying to avoid needing to install Xcode proper. In order to do this, I need to set the path to xcode for specific make files that depend on the xcode-select path (which is currently pointing to /Developer)

Where do I point the xcode-select path when using the CLI Toolkit for Xcode?

If I install Xcode, it's just /Applications/Xcode.app, but I don't know where the CLI Toolkit is being placed.

Thanks.

UPDATE:

It appears from the pkg installer that it dumps it all to /usr/bin and then xcode-select or other scripts internal to the pkg create the paths for xcodebuilder etc. Can anyone confirm?

like image 588
Lukas Avatar asked Feb 28 '12 07:02

Lukas


4 Answers

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
like image 184
billzhong Avatar answered Nov 20 '22 17:11

billzhong


I installed the CLI tools only (e.g. no Xcode) and received an error with a native gem extension build:

xcode-select: Error: No Xcode is selected. Use xcode-select -switch <path-to-xcode>, or see the xcode-select manpage (man xcode-select) for further information.

After looking at this and browsing the directories, it appears the BSD tools got installed in /usr/bin therefore:

sudo xcode-select -switch /

seems to work.

like image 23
chrischris Avatar answered Nov 20 '22 17:11

chrischris


Just did this today after removing Xcode to reclaim HD space. I used:

sudo xcode-select -s /Library/Developer/CommandLineTools
like image 19
Ben Mosher Avatar answered Nov 20 '22 18:11

Ben Mosher


I encountered this problem recently because I had several XCode versions installed on the same machine. If you have one or more XCode previously installed, you can simply reset the path with the command:

sudo xcode-select -r

This will reset the path to the default, which is /Library/Developer/CommandLineTools.

like image 4
Seto Avatar answered Nov 20 '22 17:11

Seto