xcrun问题

今天升级macOS Mojave,使用git的时候报错

1
2
~ git --version
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun

解决方法,重装xcode command line:

1
xcode-select --install

如果没有解决,执行一下命令

1
sudo xcode-select -switch