Cocoapods报错xcrun: error: active developer path ("/Users/wangwei/Downloads/Xcode.app/Contents/Developer") does not exist

今天运行pod install 居然抛出一个xcrun: error: active developer path ("/Users/wangwei/Downloads/Xcode.app/Contents/Developer") does not exist错误,然后一想昨天都是正常的,怎么会产生错误呢。突然想起早晨删除了一个低版本的Xcode,然后一看错误信息,果然是这样引起的。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.

这句话不就是说用系统管理员身份选择Xcode路径就行了吗?果断运行sudo xcode-select --switch Applications/Xcode.app, Applications/Xcode.app 为Xcode路径。然后输入密码,然后pod install更新一下,显示Pod installation complete! There are 2 dependencies from the Podfile and 2 total pods installed。大功告成,继续敲代码去!

原文地址:https://www.cnblogs.com/wniruoanhao/p/9218079.html