22

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:

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.

Any suggestions how to fix this?

McLion
  • 223
  • 1
  • 3
  • 6
  • Bump. I've tried uninstalling the command line tools with the script provided in this article: http://www.cocoanetics.com/2012/07/you-dont-need-the-xcode-command-line-tools/ and I'm still having the same problems. I reinstalled the command line tools using the separate download. Still have the same problem. – bsarrazin Aug 16 '12 at 18:09
  • FYI, I found this too: http://thomas.bindzus.me/2012/08/17/after-upgrading-to-mountain-lions-problems/ – bsarrazin Aug 16 '12 at 18:38

2 Answers2

74

I had the same problem. Originally I was doing the following for my 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.

ldiqual
  • 15,015
  • 6
  • 52
  • 90
Evan McEwen
  • 740
  • 4
  • 5
  • Worked for me, but I had to replace Xcode.app with Xcode_4.4.1.app because I renamed my Xcode.app file. – Roberto Jan 07 '13 at 08:48
  • 7
    Unfortunately, this won't work for OP's situation (mine too) where the standalone Command Line Tools are installed in `/usr/bin`. – sam Feb 05 '13 at 00:39
  • After struggling for days with this issue I found in this post my answer. Thanks a lot!. It should be marked as accepted. – Jaypee Feb 14 '13 at 14:09
  • This fixed an issue I was having with the TestFlight desktop app failing to build the IPA to upload, thanks! – Chris Wagner Aug 21 '13 at 17:59
  • If you are using Xcode5 preleases, you'll have to explcitly point to them, sudo xcode-select -switch /Applications/Xcode5-DP5.app/Contents/Developer/ – westonplatter Sep 03 '13 at 00:33
2

The only fix is hack apparently. I tried the script mentioned and it worked

OSX 10.8 xcrun (No such file or directory)

Community
  • 1
  • 1
nick
  • 52
  • 1
  • Just made a clean reinstall of my Mac. Mountain Lion, command-line tools, homebrew, rvm. And I came across this issue. The ``xcrun`` hack, though quite ugly, works well. Thanks a lot for pointing this out, I wouldn't have found the other discussion otherwise. – Pierre-Adrien Aug 02 '13 at 23:47