转自:https://stackoverflow.com/questions/9849034/how-to-run-install-xcodebuild
执行下面的指令即可
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer