xcode xcrun:错误:无法执行真正的 xcrun。(无此文件或目录)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11977648/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
xcrun: Error: failed to exec real xcrun. (No such file or directory)
提问by McLion
I've upgraded OSX Lion to Mountain Lion and reinstalled the Command Line Tools (as the upgrade deleted them). From then xcrun does not work anymore. The xcode-select is set to /usr/bin, the binaries are in that directory too, but if I run xcrun with an argument (ex. xcrun gcc) it displays this:
我已经将 OSX Lion 升级到 Mountain Lion 并重新安装了命令行工具(因为升级删除了它们)。从那时起 xcrun 不再起作用。xcode-select 设置为 /usr/bin,二进制文件也位于该目录中,但是如果我使用参数(例如 xcrun gcc)运行 xcrun,它会显示以下内容:
xcrun: Error: failed to exec real xcrun. (No such file or directory)
I've tried setting the path again with xcode-select and reinstalled the CLT. Nothing helped.
我已经尝试使用 xcode-select 再次设置路径并重新安装了 CLT。没有任何帮助。
Any suggestions how to fix this?
任何建议如何解决这个问题?
采纳答案by nick
The only fix is hack apparently. I tried the script mentioned and it worked
唯一的修复显然是hack。我尝试了提到的脚本并且它起作用了
回答by Evan McEwen
I had the same problem. Originally I was doing the following for my xcode-switch:
我有同样的问题。最初我正在为我的 xcode-switch 执行以下操作:
$ sudo xcode-select -switch /Applications/Xcode.app/
However what was really needed was:
然而,真正需要的是:
$ sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/
This fixed the problem for me. Not sure if sudo is needed.
这为我解决了问题。不确定是否需要 sudo。