Mac上有兩個Xcode,一個是正式版轻腺,另一個安裝的測試版,pod install的時候發(fā)現(xiàn)報錯划乖,找不到對應(yīng)的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`.
經(jīng)百度查找,了解如下可以解決此問題:
sudo xcode-select --switch /Applications/Xcode.app