mac安装CommandLineTools

栏目: mac 发布时间:2022-02-08

系统升级到 Monsterey 版本后,xcode 不能用了,终于可以开心地卸载了(不常用,占用十多G的空间,一直在纠结要不要卸载)。

卸载 xcode 后,命令行工具不能正常使用了,报错如下:

$ git status
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

原因:缺失 CommandLineTools。安装即可。

安装 CommandLineTools

$ xcode-select --install

根据引导提示完成安装即可。安装完 CommandLineTools 后,命令行可以正常使用了。

$ git status
On branch hotfix_1130
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

本文地址:https://www.tides.cn/p_mac-install-command-line-tools