I was forced to reinstall Xcode 4 and now I'm constantly seeing errors like "Xcode appears to be installed but xcodebuild is unusable" and "xcodebuild exists but failed to execute" whenever I try to install packages via ports:
ash-3.2$ sudo port install wget
Password:
Warning: xcodebuild exists but failed to execute
Warning: configured user/group adm does not exist, will build as root
Warning: Xcode appears to be installed but xcodebuild is unusable; some ports will likely fail to build.
Warning: You may need to run `sudo xcode-select -switch /Applications/Xcode.app`
---> Computing dependencies for wget
Is xcodebuild pointing to the wrong path, or does it need to be in the /Developer folder?
$ which xcodebuild
/usr/bin/xcodebuild
$ /usr/bin/xcodebuild
error: can't exec '/Developer/usr/bin/xcodebuild' (No such file or directory)
What's wrong with this utility? How can I fix it (I've already reinstalled Xcode)?
Update:
port worked fine even without xcodebuild; I suspect MacPorts uses make and the warnings are just alerts that I might have a problem with Xcode.
That's interesting. I tried sudo xcode-select -switch /Applications/Xcode.app, but it didn't seem to work immediately after reboot. Today, however, it did—after accepting the license agreement. Now that xcodebuild is functional, I can proceed and thank everyone for the help.
Source: Apple Stack Exchange Archive (CC BY-SA 4.0)