101

I just upgraded XCode to 4.3.1. I'm using a script to build (and then deploy through Testflight) my app. But I now receive this error:

Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path.

I've no /Developer dir in my machine: how can I fix it?

Christian Hudon
  • 1,881
  • 1
  • 21
  • 42
Giordano Scalzo
  • 6,312
  • 3
  • 31
  • 31

4 Answers4

245

sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Jim
  • 72,985
  • 14
  • 101
  • 108
  • 3
    And what do I do if that doesn't work? I do exactly the you say, get no error, and then do "xcodebuild -version" and get the error "Error: No developer directory found at /Developer. Run /usr/bin/xcode-select to update the developer directory path." – Henning Mar 17 '12 at 20:09
  • It doesn't sound like xcode-select ran properly. Double-check that the path is set correctly by running `xcode-select -print-path`. – Jim Mar 21 '12 at 13:07
  • got this warning when updating MacPorts via `sudo port selfupdate`, perfect solution! – Gabor Apr 03 '12 at 19:50
  • 1
    Happens because from about Xcode 4.2 Apple started distributing it as an app, downloadable from the App Store. Consequently, all tools are installed in the Applications/Xcode.app package. – Sudhir Jonathan Apr 09 '12 at 10:53
  • 3
    I had to create a soft link pointing /Developer to /Applications/Xcode.app/Contents/Developer/. That's the only solution I could find. – Henning Apr 30 '12 at 17:50
  • xcode-select --print-path gives me /Developer. If I do the above, then it's still /Developer. I can't seem to change it. Doing a build gives me "xcrun: error: unable to find Xcode installation". It's not fixed if I create a soft link to /Developer. This is very frustrating. – Henning Mar 20 '13 at 15:32
  • New path seems to be /Library/Developer: http://stackoverflow.com/questions/12780858/xcode-4-5-command-line-tools-xcode-select-issue – AndreyM Sep 19 '13 at 09:33
  • This answer was helpful to me because I received the error upon attempting to run `cordova build` , when I was following the cordova ios platform guides( http://cordova.apache.org/docs/en/3.3.0/guide_platforms_ios_index.md.html#iOS%20Platform%20Guide ). Other people trying to follow along with those guides might have the same problem I did. – Daniel Dropik Jan 04 '14 at 23:31
5

You could also do this instead ...

sudo ln -s /Applications/Xcode.app/Contents/Developer /Developer
Jeremy
  • 103
  • 5
  • 6
    It's an attempt to hide the problem, not fix it. If you do that, all of the tools are still looking in the wrong place. – Jim Apr 20 '12 at 12:13
  • Even after doing this command i get this error xcode-select: Error: Path "/Applications/Xcode.app/Contents/Developer" is not a directory. There is no Developer directory even after doing this command – abhishek Aug 04 '13 at 10:02
3

Everything you guys answered is correct. But for those who hit the following error are missing a step:

Error:

  "xcode-select: Error: Path "/Applications/Xcode.app/Contents/Developer" is not a directory."

Missing step:

Double click your xcode 432.dmg. Now don't double click the xcode.app to use it. Instead copy it /Applications folder and then open it from there to install xcode.

Now use terminal command

 sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

Thats it. Your error won't happen again and Filemerge will work now.

Deepukjayan
  • 3,525
  • 1
  • 20
  • 31
2

This solved for me:

Mostly this error occurs when you have installed a newer version of xcode. And the command line tools are yet to be initialized.

To resolve this: Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Please select the Xcode version for tools.

Example (For Xcode 8.3.3): Go under Xcode Preferences > Locations (tab) > And the bottom options is Command Line Tools. Select Xcode 8.3.3 (7D1014).

Samman Bikram Thapa
  • 1,037
  • 12
  • 15