gpt4 book ai didi

xcode - 如何更新 Xcode 命令行工具?

转载 作者:行者123 更新时间:2023-12-03 00:57:56 28 4
gpt4 key购买 nike

我正在尝试更新 mac osx 上的命令行工具。

~  softwareupdate --list
Software Update Tool
Copyright 2002-2015 Apple Inc.

Finding available software
Software Update found the following new or updated software:

* Command Line Tools (macOS El Capitan version 10.11) for Xcode-8.2
Command Line Tools (macOS El Capitan version 10.11) for Xcode (8.2), 150374K [recommended]
* iTunesX-12.5.5
iTunes (12.5.5), 263476K [recommended]

但是当我运行更新命令时,出现此错误:

softwareupdate -i Command Line Tools (macOS El Capitan version 10.11) for Xcode-8.2
zsh: number expected

这也不起作用:

softwareupdate -i Command Line Tools
Software Update Tool
Copyright 2002-2015 Apple Inc.

Command: No such update
Line: No such update
Tools: No such update
No updates are available.

sofwareupdate -i 命令后我应该指定什么具体字符串?

最佳答案

对于 future 的旅行者,这里有一个与版本无关的方法。首先,运行softwareupdate --list。这可能需要几分钟。完成后,您将看到一个带项目符号(带有星号)的输出,如下所示:

$ softwareupdate --list
Software Update Tool

Finding available software
Software Update found the following new or updated software:
* Command Line Tools (macOS High Sierra version 10.13) for Xcode-10.1
Command Line Tools (macOS High Sierra version 10.13) for Xcode (10.1), 190584K [recommended]

找到引用 Xcode 命令行工具的项目符号。复制整行(星号除外......)。在上述情况下,您将复制:Command Line Tools (macOS High Sierra version 10.13) for Xcode-10.1

然后,使用您在引号内复制的内容运行安装命令(如 Brendan Shanks 所示):

softwareupdate -i "Command Line Tools (macOS High Sierra version 10.13) for Xcode-10.1"

关于xcode - 如何更新 Xcode 命令行工具?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42538171/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com