Mac上有两个Xcode,一个是正式版,另一个安装的测试版,pod install的时候发现报错,找不到对应的Xcode,错误如下:
Setting up CocoaPods master repo
$ /usr/bin/git remote set-url origin https://github.com/CocoaPods/Specs.git
xcrun: error: active developer path ("/Applications/Xcode.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`)
[!] Failed: /usr/bin/git remote set-url origin https://github.com/CocoaPods/Specs.git
$ /usr/bin/git checkout master
xcrun: error: active developer path ("/Applications/Xcode.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`)
[!] Failed: /usr/bin/git checkout master
[!] Unable to add a source with url `https://github.com/CocoaPods/Specs.git` named `master-1`.
(The `master` repo is not a git repo.)
You can try adding it manually in `~/.cocoapods/repos` or via `pod repo add`.
经百度查找,了解如下可以解决此问题:
sudo xcode-select --switch /Applications/Xcode.app