安装Xcode Command Line Tools

2017-05-01|Categories: macOS|

全新安装macOS Sierra之后,在安装Homebrew的时候失败,错误信息如下:

xcode-select: error: invalid developer directory '/Library/Developer/CommandLineTools'
Failed during: /usr/bin/sudo /usr/bin/xcode-select --switch /Library/Developer/CommandLineTools

这表示Command Line Tools还没有安装,解决步骤如下:

  1. xcode-select --install
    • 备注:看到下面这个信息表示CLT已经安装。
      xcode-select: error: command line tools are already installed, use "Software Update" to install update
      
  2. 点击 “Install” 安装 Xcode Command Line Tools:

  3. 点击 “Agree” 接受许可协议:

  4. 开始下载、安装:

  5. 安装完成:

  6. 检查安装路径:

    $ xcode-select –p
    /Library/Developer/CommandLineTools
    

Leave A Comment