1. 情景:
mac之前安装的是Xcode6.2版本,当重新安装了Xcode7.0并且删了原来的6.2版本之后,在终端下使用git时,出现了错误如下:
xcrun: error: active developer path (“/Applications/Xcode 6.2.app/Contents/Developer”) does not exist, use xcode-select --switch path/to/Xcode.app
to specify the Xcode that you wish to use for command line developer tools (or see man xcode-select
)
2. 解决办法:
在终端中修改你的CommandLine Tools的位置,执行命令:
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
- 注意:如果你的应用程序的名字为Xcode7.app,就把上面的命令行改为
sudo xcode-select -switch /Applications/Xcode7.app/Contents/Developer