用mac的小伙伴一定知道,xcode的下载和安装总是让人感觉那么的烦躁,不安装xcode又会无法使用各种东西,比如git,有没有一种方法不安装xcode,或者不升级xcode就可以正常使用呢
昨晚升级了xcode,然后一直提示正在安装,正巧,这个时候需要合并分支用到了git,但是提示
-> git
xcrun: error: active developer path
("/Applications/Xcode.app/Contents/Developer")
does not exist, usexcode-select --switch path/to/Xcode.app
to specify the Xcode that you wish to use for command line
developer tools (or seeman xcode-select
)
解决的方法如下:
- xcode-select --install // 单独安装CommandLineTools
- sudo xcode-select --switch /Library/Developer/CommandLineTools // 指定路径
打开一个新的终端:
- xcode-select --install
- sudo xcode-select --switch 指定的路径