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