我整天都在试着解决这个问题!
我已xcode-select -switch /path/to/xcode/按照此处的建议尝试了建议,但它仍然给了我这个错误!
我现在已经完全删除了XCode 4.4和命令行工具,并且运行xcrun仍然给我这个错误!
即使安装新的Xcode副本和命令行工具也会产生此错误!
命令结果..
sh-3.2# xcode-select -print-path
/Applications/Xcode.app/Contents/Developer
sh-3.2# xcrun -find
xcrun: Error: could not stat active Xcode path '/Volumes/Xcode/Xcode45-DP1.app/Contents/Developer'.           (No such file or directory)
Aar*_*ger 209
xcode-select是答案.您指向错误的路径,或者您没有以root用户身份执行此操作.在终端尝试这个:
sudo xcode-select -switch /Applications/Xcode.app
然后键入您的密码.
如果
sudo,或改为覆盖DEVELOPER_DIR环境变量:
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
可选:您可以通过编辑.bash_profile文件在登录会话之间保持此状态.
如果两种解决方案均无效,请发布错误消息.
Shm*_*idt 15
问题是/usr/share/xcode-select/xcode_dir_link指向旧文件夹,并且在命令时不会更新
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/ 被执行.
解决方案:删除此链接并手动创建.