1. 安装:XCode CommandLine Tools
xcode-select --install
安装成功后,使用下面指令验证:
xcode-select -p
打印结果:/Library/Developer/CommandLineTools
2. 升级XCode CommandLine Tools
升级要使用系统的Software Update
进行升级,点击左上角的苹果图标 -> 关于本机。
3. 切换路径
卸载了XCode后,更新版本的Command Line Tools之后,需要切换到新版本的路径。
# reset to the default command line tools path
sudo xcode-select -r
sudo xcode-select --switch /Library/Developer/CommandLineTools