macOS 10.14(beta) 如何安装 Command_Line_Tools_macOS_10.14_for_Xcode_10_Beta

macOS 10.14(beta) How to install Command_Line_Tools_macOS_10.14_for_Xcode_10_Beta

作为我的问题的标题,我不知道如何为我的mac安装Command_Line_Tools_macOS_10。14_for_Xcode_10_Beta,请帮助。

我做了什么:

  1. 运行命令"brew install carthage"安装Carthage,报错:

Error: Your Xcode (9.4.1) is too outdated. Please update to Xcode 10.0 (or delete it). Xcode can be updated from https://developer.apple.com/download/more/

  1. 运行 在终端中命令 "xcode-select --install" 作为 the second answer from @Dev,但在 "brew install carthage";
  2. 之后我仍然得到相同的错误

  1. Apple site下载.dmg文件,打开后工具太多:

我已经尝试安装附图中标有红色矩形的两个.pkg,但错误仍然存​​在。

环境:

macOS 10.14 Beta
Xcode(Installed 2 versions on the Mac): 
10 (Beta), 
9.4.1

您的机器上似乎安装了两个版本的 xcode。 首先select最新版本xcode通过运行这个命令:

sudo xcode-select -switch <path/to/>Xcode.app

完成后,安装所需的命令行工具,但运行此命令:

xcode-select --install

这对我有用:

  1. https://developer.apple.com/download/
  2. 下载 "Xcode 10.0 Beta"
  3. 解压并移动到/Applications
  4. https://developer.apple.com/download/more/
  5. 下载 "Command Line Tools (macOS 10.14) for Xcode 10 Beta"
  6. 运行 "Command Line Tools"
  7. 的安装程序
  8. 启动 Xcode-beta 应用程序并等待它在启动时提示安装必要的软件包
  9. 运行 这来自命令行 sudo xcode-select -switch /Applications/Xcode-beta.app/

现在 brew update 应该又可以工作了。

Beta 3 和 Homebrew 存在问题。我真的花了 2 个小时尝试这里列出的所有内容,但都无济于事。我只能通过安装 Beta 2、安装 Homebrew 然后更新到 Beta 3 来让它工作。

Homebrew and Beta 3 - Command Line Tools

在全新的 10.14 Beta 3 安装中,这为我解决了一些问题。

sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /

在终端 运行 命令中:

sudo xcode-select -switch /Applications/Xcode-beta.app

注意: xcode-select --install 命令已弃用,但命令行工具应该已经安装。

以下对我有用:

更新到 Mojave 10.14 后 转到 https://developer.apple.com/download/more/ 搜索 "command line" 然后

下载“适用于 MacOS 10.14 的命令行工具

下载 dmg 后安装软件包。

验证包安装