I have installed the Command Line Tools:
$ xcode-select --print-path
/Library/Developer/CommandLineTools
However, when anything tries to use xcodebuild
, I get the following error:
$ /usr/bin/xcodebuild
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
On Mountain Lion it was possible to use this without installing the whole of Xcode, rather just the Command Line Tools. Is it possible to do this on Mavericks? How can I get it working?
N.B. This is on a clean install of Mavericks.
Update: just to show, I do have the Command Line Tools installed:
$ gcc --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)
Target: x86_64-apple-darwin13.0.0
Thread model: posix
AFAIK, command line tools in Mavericks are installed into /Applications/Xcode.app/Contents/Developer which tends to imply that Xcode is required. Undocumented feature probably.
If you use XCode2: sudo xcode-select --switch /Applications/Xcode\ 2.app/Contents/Developer
Pay attention to the "\" to escape the space.
This issue was due to xcode-select developer directory pointing to
/Library/Developer
, which only contained the folderCommandLineTools
. To this end, the error message is complaining about not the directory not being the same as Xcode.Two tested solutions:
(Re) Install Xcode.
Point xcode-select to the Xcode Developer Directory using the following command:
References:
How to fix error like “xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory
xcode-select active developer directory error
I know that this is a late answer, but in my case this command solved the issue:
It appears that OSX has changed
xcodebuild
to requireXCode
to be installed, where before it functioned properly with only the OSX Command Line Tools installed.Old semi-related answer
Many people ran into this with Node. Node's build tool,
gyp
, usesxcodebuild
to prepare for compiling node packages. Mavericks has changed the behavior ofxcodebuild
so that it no longer works properly withgyp
. This is being fixed at the moment. See the node-gyp issueOnce the changes have been deployed to NPM, you will be able to install the new
node-gyp
package and compile properly. You will also need to update your NPM version once the changes are incorporated into NPM.Today I had this issue and the problem was I was using a manual install of xcode and had the file named Xcode8.3.2.app instead of Xcode.app. Renaming the app fixed the issue of xcode-select complaining. This seems to indicate the regular appname is on its search path but variants are not.