Apple - Xcode appears to be installed but xcodebuild is unusable

Did you run sudo xcode-select -switch /Applications/Xcode.app? This message: error: can't exec '/Developer/usr/bin/xcodebuild' is telling you that your system is looking for xcodebuild in `/Developer/usr/bin/' but as of Xcode 4.3 (the one that's installed from the App Store) it's located in the Xcode.app bundle which is in /Applications.

Edit

In a comment to your question you say you've run sudo xcode-select -switch /Applications/Xcode.app. Now run xcode-select -print-path and make sure it says "/Applications/Xcode.app".

Also, you may need to download the command line tools separately. (I don't know from first-hand experience because I'm stuck on Snow Leopard for the moment so I haven't installed Xcode 4.3.)


As stated here https://trac.macports.org/wiki/ProblemHotlist, you need to run:

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

I had the same problem. After upgrading to Mountain Lion and upgrading Xcode to version 4.4.1 including the command-line tools, I could not call xcodebuild from the terminal anymore.

Then I stumbled upon a setting in Xcode's preferences where I had to choose which command-line tools I wanted to use, a bit silly since there were only one option.

enter image description here

http://thomas.bindzus.me/2012/08/17/after-upgrading-to-mountain-lions-problems/

I found this to be the easiest way to restore my command-line tools.

Tags:

Xcode

Macports