xcode-select --install xcode-select:错误:未知命令选项“--install”

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

xcode-select --install xcode-select: Error: unknown command option '--install'

xcodeterminalcommand-line-arguments

提问by Suraj K Thomas

i am trying to install Command line tools on Xcode from terminal.I am using Xcode

我正在尝试从终端在 Xcode 上安装命令行工具。我正在使用 Xcode

Version 5.1.1 (5B1008). I have installed command line tools within Xcode,enter image description here

版本 5.1.1 (5B1008)。我已经在 Xcode 中安装了命令行工具,在此处输入图片说明

Now if i try to install Command Line tools in terminal i get thisenter image description here

现在,如果我尝试在终端中安装命令行工具,我会得到这个在此处输入图片说明

How to solve this ? xcode-select version 2311.I tried the following things

如何解决这个问题?xcode-select 版本 2311.I 尝试了以下内容

1.my path is /Applications/Xcode.app/Contents/Developer,so i switched like this

1.我的路径是/Applications/Xcode.app/Contents/Developer,所以我是这样切换的

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

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

Nothing happened i get same error command not found.

什么也没发生,我得到相同的错误命令未找到。

2.I followed this link but was not useful xcrun: Error: could not stat active Xcode path '/Volumes/Xcode/Xcode45-DP1.app/Contents/Developer'. (No such file or directory)

2.我点击了这个链接但是没有用xcrun: Error: could not stat active Xcode path '/Volumes/Xcode/Xcode45-DP1.app/Contents/Developer'。(无此文件或目录)

Any thoughts are welcome

欢迎任何想法

采纳答案by Suraj K Thomas

i figured out.The problem was i was using outdated version of mavericks,i updated to the latest version and everything was working.First step is to make sure your version is up to date

我想通了。问题是我使用的是过时版本的小牛,我更新到最新版本并且一切正常。第一步是确保您的版本是最新的

回答by TechnoCat

This same problem stumped me for over an hour when setting up a new MacBook Pro with the latest version of High Sierra.

在使用最新版本的 High Sierra 设置新的 MacBook Pro 时,同样的问题让我难住了一个多小时。

The solution - curiously - was that:

奇怪的是,解决方案是:

  • copying & pasting "xcode-select --install" failed continually, but
  • typing in the same command "xcode-select --install" worked immediately.
  • 复制和粘贴“xcode-select --install”不断失败,但是
  • 输入相同的命令“xcode-select --install”立即生效。

(Someone else may understand why pasting a simple line of code did not produce the same result as entering it from the keyboard.)

(其他人可能会理解为什么粘贴一行简单的代码不会产生与从键盘输入相同的结果。)