macOS 升级后出现xcrun: error: invalid active developer path

Posted by Keystion on 2018-09-26

Xcode CommandLineTools

发现 MacOS 升级系统之后总会报错 git 找不到,无论是 macOS High Sierra ,还是 macOS Mojave

错误信息:

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

解决方法,重装 xcode CommandLineTools:

1
xcode-select --install

如果没有解决问题,执行以下命令

1
sudo xcode-select -switch /