问题描述
最近升级了MAC版本,然后重新打开IDEA,并使用GIT时,发现IDEA有一个弹窗报错:Cannot Run Git,查看详细的报错信息:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
解决办法
首先在命令行执行:
xcode-select --install
如果还是报错,并且提示报错信息为:xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
那么就查找 xcrun 文件,并复制到:/Library/Developer/CommandLineTools/usr/bin/
命令
locate xcrun // 查找到该文件在:/usr/bin/xcrun
sudo cp /usr/bin/xcrun /Library/Developer/CommandLineTools/usr/bin/ //复制到目录
执行完商品的操作,如果还报错,那么重启IDEA再看一下