xcode 升级到 El Capitan 后无效的活动开发者路径错误

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

Invalid active developer path error after upgrading to El Capitan

xcodegit

提问by jhnath

I ran into this error trying to push to git, when I typed git init.

当我输入 git init 时,我在尝试推送到 git 时遇到了这个错误。

xcrun: error: invalid active developer path
(/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

xcrun: 错误: 无效的活动开发者路径
(/Library/Developer/CommandLineTools),在以下位置缺少 xcrun:/Library/Developer/CommandLineTools/usr/bin/xcrun

I tried the following solutions.

我尝试了以下解决方案。

xcode-select —install
sudo xcode-select -switch
sudo xcode-select —install
brew doctor
brew update
brew upgrade
brew cleanup

采纳答案by Michael Dautermann

1)

1)

try typing in "xcode-select -print-path" and see if the path you see is the path you're expecting for your current Xcode version.

尝试输入“ xcode-select -print-path”,看看您看到的路径是否是您当前 Xcode 版本所期望的路径。

2)

2)

If you go to:

如果你去:

https://developer.apple.com/downloads/

https://developer.apple.com/downloads/

(you'll need to sign in with your Apple Developer account)

(您需要使用您的 Apple Developer 帐户登录)

Once there, you'll see links for "Command Line Tools". It sounds like you need to install MacOS 10.11 Command Line Tools for Xcode 7.

在那里,您将看到“命令行工具”的链接。听起来您需要为 Xcode 7 安装 MacOS 10.11 命令行工具

回答by Arcolye

This is all you need to do:

这就是您需要做的所有事情:

$ xcode-select --install

回答by nikhilgohil11

You can select command line tools from the XCode Preferences shown in the screenshot below.

您可以从下面屏幕截图中显示的 XCode 首选项中选择命令行工具。

You will be prompted for password.

系统将提示您输入密码。

enter image description here

在此处输入图片说明

回答by r4m

Try:

尝试:

sudo xcode-select -r

sudo xcode-select -r

in this way it unsets any user-specified developer directory, so that the developer directory will be found via the default search mechanism.

通过这种方式,它会取消设置任何用户指定的开发人员目录,以便通过默认搜索机制找到开发人员目录。

回答by Hassan Hussein

If you have Catalina and Xcode 11 and you have this problem, then go to Xcode Preferences and select Location tab, check that the Command Line tool dropdown has Xcode 11.0 selected. If Xcode 11 is not there then you need to download and install Command-line tools for Xcode 11 here (choose the correct Beta)

如果您有 Catalina 和 Xcode 11 并且遇到此问题,请转到 Xcode Preferences 并选择 Location 选项卡,检查命令行工具下拉列表是否选择了 Xcode 11.0。如果 Xcode 11 不存在,那么您需要在此处下载并安装 Xcode 11 的命令行工具(选择正确的 Beta)

https://developer.apple.com/download/more/?=command%20line%20tools

https://developer.apple.com/download/more/?=command%20line%20tools