前不久安装了macOS Big Sur beta,然后Xcode就不能工作了,需要更新到相应的beta版。我实际也没有使用到Xcode,所以删除了Xcode.app并安装Beta版本的Command Line Tools即可满足需求。
出现这个错误是因为跑make
的时候路径仍然是旧的Xcode路径
$ make
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
这里尝试修复但是没有奏效
$ sudo xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
只能reset,之后make就可以顺利运行了
sudo xcode-select --reset