更改 Xcode 的活动开发人员路径

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

Change active Developer Path for Xcode

ruby-on-railsxcodegccxcrun

提问by MatrixMummy

This question was asked before, but unresolved here.

这个问题之前有人问过,但在这里没有解决。

I have tried the solution here, but it doesn't solve the issue.

我在这里尝试了解决方案,但它没有解决问题。

I get this error:

我收到此错误:

xcrun: error: active developer path ("/Applications/Xcode 2.app/Contents/Developer") does not exist, use xcode-select to change

The active developer path should NOTsay "Xcode 2.app", but instead "Xcode.app".

在活跃的开发路径应该说“的Xcode 2.app”,而是“Xcode.app”。

My question is: How can I change the active path to say "Xcode.app"?

我的问题是:如何将活动路径更改为“Xcode.app”?

I already tried the following:

我已经尝试了以下方法:

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

I have tried reinstalling Xcode, but the problem persists.

我尝试重新安装 Xcode,但问题仍然存在。

采纳答案by MatrixMummy

Doing a hard reset on my computer fixed my issue.

在我的电脑上进行硬重置解决了我的问题。

I agree that the answer below, the one with the most upvotes, is helpful to most people who encounter this problem.

我同意下面的答案,即获得最多票数的答案,对大多数遇到此问题的人都有帮助。

回答by Xavier KRESS

Have you tried to execute the switch command as root with a sudo command ?

您是否尝试使用 sudo 命令以 root 身份执行 switch 命令?

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

回答by Prn2698

There is one more option without terminal, we can change active developer path through Xcode.

还有一个没有终端的选项,我们可以通过 Xcode 改变活跃的开发者路径。

Launch Xcode, Go to Xcode -> Preferences -> Locations and in Command Line tools will list down all the installed Xcode list. From the drop down you can select any Xcode for active developer path.

启动 Xcode,转到 Xcode -> Preferences -> Locations 并在命令行工具中列出所有已安装的 Xcode 列表。从下拉列表中,您可以为活动的开发人员路径选择任何 Xcode。

Using this selection, you can set any Xcode (if you have multiple installed Xcode's in your machine and you want change default one) set as a default active developer path.

使用此选项,您可以将任何 Xcode(如果您的机器上安装了多个 Xcode 并且您想要更改默认设置)设置为默认的活动开发人员路径。

Happy Coding :)

快乐编码:)

回答by user1039695

It Occurs to me when i renamed my Xcode application to xcode6.4

当我将我的 Xcode 应用程序重命名为 xcode6.4 时,它发生在我身上

You have to give new path by replacing Xcode to renamed Xcode application

您必须通过将 Xcode 替换为重命名的 Xcode 应用程序来提供新路径

Example:- sudo xcode-select -switch /Applications/Xcode6.4.app/Contents/Developer

例子:- sudo xcode-select -switch /Applications/Xcode6.4.app/Contents/Developer

回答by Ajay

Hovanter, There is a possibility that you have multiple Xcode versions in your Application folder. Also you might have updated the name of your Xcode.

Hovanter,您的应用程序文件夹中可能有多个 Xcode 版本。此外,您可能已经更新了 Xcode 的名称。

Search your 'Xcode name' from Application folder and then enter the command below : sudo xcode-select -switch /Applications/"Xcode name.app"/Contents/Developer

从应用程序文件夹中搜索您的“Xcode 名称”,然后输入以下命令: sudo xcode-select -switch /Applications/"Xcode name.app"/Contents/Developer

It worked for me. How about you?

它对我有用。你呢?

回答by be.with.veeresh

If xcode is yet not installed, then this error occurs. So, Install xcode then go for checkout.

如果尚未安装 xcode,则会发生此错误。所以,安装 xcode 然后去结帐。