我正在尝试从命令行更新Xcode。一开始我试着跑步:
xcode-select --install
这就产生了这条信息:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
那么问题来了,有没有办法从命令行更新Xcode呢?
我正在尝试从命令行更新Xcode。一开始我试着跑步:
xcode-select --install
这就产生了这条信息:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
那么问题来了,有没有办法从命令行更新Xcode呢?
当前回答
我在删除Xcode后得到这个错误。我通过使用sudo xcode-select -r重置命令行工具路径来修复它。
之前:
navin@Radiant ~$ /usr/bin/clang
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
navin@Radiant ~$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
后:
navin@Radiant ~$ /usr/bin/clang
clang: error: no input files
其他回答
我在删除Xcode后得到这个错误。我通过使用sudo xcode-select -r重置命令行工具路径来修复它。
之前:
navin@Radiant ~$ /usr/bin/clang
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
navin@Radiant ~$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
后:
navin@Radiant ~$ /usr/bin/clang
clang: error: no input files
@Vel Genov的回答是正确的,除非Xcode的版本无法更新,因为它是当前Mac OS的最新版本。如果你知道有更新的Xcode(例如,它不会将应用加载到最新版本的iOS设备上),那么有必要先升级Mac OS。
对于像我这样使用旧Mac Pro 5.1的人来说,还有一点值得注意。升级到Mojave需要安装金属gpu(蓝宝石AMD Radeon RX 560在我的情况下),但确保只安装HDMI监视器(不是4K!1080只)。然后才安装Mojave说固件更新需要关闭电脑。长2分钟的电源按钮保持,它都升级好之后!
如果有一个挂起的更新,install -a不会从命令行升级xcode(假设你选择了隔夜更新xcode)
在Xcode (Mac上的App Store)更新了我的Xcode之后,我就遇到了这个问题。
我的SourceTree不允许我合并冲突。 在Xcode中,我发现命令工具没有被选中。 我选择了它,但仍然没有骰子,因为我得到了相同的信息:
我执行命令:
softwareupdate——列表
它给了我一个产品列表,包括三(3)个版本的命令行工具 软件更新工具
寻找可用软件 软件更新发现以下新的或更新的软件:
标签:Xcode-13.2的命令行工具 标题:命令行工具的Xcode,版本:13.2,大小:577329K,推荐:是, 标签:sfsymbolsauto - 3.3 标题:SF符号,版本:3.3,尺寸:169368K,推荐:是, 标签:Xcode-13.3的命令行工具 标题:命令行工具的Xcode,版本:13.3,大小:718145K,推荐:是, 标签:Xcode-13.4的命令行工具 标题:命令行工具的Xcode,版本:13.4,大小:705462K,推荐:是,
我的Xcode版本是13.4,所以我先试着只更新一个。 我使用了标签,带有转义的空格(它也适用于引用的标签,顺便说一下“Xcode-13.4的命令行工具”)
softwareupdate -i命令行工具
这样一来,命令行工具的所有3个更新都消失了,我得以继续。
希望这能帮助到其他人。
我现在运行OS大苏尔。Xcode-select——install,和sudo Xcode-select——reset没有解决我的问题,也没有推荐后续的软件更新——install -a命令。除此之外,我还尝试了从Apple Downloads下载的推荐下载,但那里可用的命令行工具下载与我的操作系统不兼容。
我对为我解决的修复方案进行了投票,sudo xcode-select——switch /Library/Developer/CommandLineTools/,并添加了这篇文章用于环境上下文。
你好,我是这样解决的:
安装应用程序> Xcode。>内容>资源>包> XcodeSystemResources.pkg。