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

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9621706/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:17:49  来源:igfitidea点击:

How can I resolve "Error: No developer directory found at /Developer"?

xcodemacosxcodebuild

提问by Giordano Scalzo

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:

我刚刚将 XCode 升级到 4.3.1。我正在使用脚本来构建(然后通过 Testflight 部署)我的应用程序。但我现在收到此错误:

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

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

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

我的机器中没有 /Developer 目录:我该如何修复它?

回答by Jim

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

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

回答by Jeremy

You could also do this instead ...

你也可以这样做......

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

回答by Deepukjayan

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.

就是这样。你的错误不会再发生,Filemerge 现在可以工作了。

回答by Samman Bikram Thapa

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.

大多数情况下,当您安装了较新版本的 xcode 时会发生此错误。命令行工具尚未初始化。

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

要解决此问题:转到 Xcode 首选项 > 位置(选项卡)> 底部选项是命令行工具。请为工具选择 Xcode 版本。

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

示例(对于 Xcode 8.3.3):转到 Xcode Preferences > Locations (tab) > 底部选项是 Command Line Tools。选择 Xcode 8.3.3 (7D1014)。