如何解决“错误: 在/Developer 中找不到开发人员目录”?

我刚把 XCode 升级到4.3。 我使用一个脚本来构建(然后通过 TestFlight 部署)我的应用程序。 但我现在收到了这个错误:

错误: 在/Developer 中找不到开发人员目录。运行/usr/bin/xcode-select 以更新开发人员目录路径。

我的机器中没有/开发人员目录: 如何修复它?

53812 次浏览

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

You could also do this instead ...

sudo ln -s /Applications/Xcode.app/Contents/Developer /Developer

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.

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).