问题发现:
最近要打包ios app上线苹果商店审核,就下载了xcode,所以就升级了mac系统到Big Sur。然后打开webstorm发现git不能用了 提示Cannot Run Git
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
在命令行输入 :git --help
提示缺少CommandLineTools
mac@MacdeMacBook-Pro ~ % git --help
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
问题解决:
1.一种方法是在命令行输入 :
xcode-select --install
2.另一种可以直接苹果开发者官网下载,地址: https://developer.apple.com/download/more/?=for%20Xcode
3.安装软件
安装完成,重启webstorm,git就可以使用了!