一、背景
使用命令行提交代码到git时,出现报错
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
二、分析
1.可能是之前卸载了Xcode,然后重装的时候造成的路径错误。 invalid active path
三、处理
1.可以通过终端命令来指定一个路径
xcode-select --switch /Library/Developer/CommandLineTools
2.重置默认开发工具路径
sudo xcode-select -r
四、结论
然后打印一下
//执行重置命令
sudo xcode-select -r
xcode-select -p
// 打印结果如下:
/Applications/Xcode.app/Contents/Developer
OK,可以继续使用了。
网友评论