OSX 10.8 xcrun (No such file or directory)

让人想犯罪 __ 提交于 2019-12-02 17:09:11

Unfortunately, at least the last time I played with it, I found you really can't use xcrun with just the standalone Command Line Tools package. It apparently wasn't designed for that use case; the standalone package is a fairly recent innovation with Xcode 4. If the product you are trying to install really depends on xcrun, you may need to install the full Xcode.app distribution to get around it. That, or modify the distribution's Makefile et al to not use xcrun. Or, possibly (untested), create some directories and/or symlinks to fake xcrun into thinking you have Xcode.app installed - a messy hack.

Type in these commands on the console:

sudo xcode-select -switch /usr/bin
sudo mv /usr/bin/xcrun /usr/bin/xcrun-orig
sudo vim /usr/bin/xcrun

Enter the following into your dummy xcrun file:

#!/bin/sh
$@

Then make it executable:

sudo chmod 755 /usr/bin/xcrun

Even with Command Line Tools installed, your xcode-select is strange. It should be pointing into your XCode bundle, not /usr/bin:

$ xcode-select -print-path
/Applications/Xcode.app/Contents/Developer

Switch it to Xcode like this:

$ sudo xcode-select --switch /Applications/Xcode.app

I was having trouble with brew install hg. It was choking on the output of xcodebuild -version.

It is a horrible hack, but I replaced /usr/bin/xcodebuild with a shell script that just echoed "4.3" and was able to install mecurial successfully.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!