准备查看线上bug的时候,弹出报错提示,如下
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 seeman xcode-select
)
很明显是说/Applications/Xcode.app/Contents/Developer
这个路径出错,然后就想到自己在安装的时候改过xcode默认的名字,因此直接修改一次路径就完事了
sudo xcode-select -switch /Applications/Xcode\ 7.3.app/Contents/Developer
我的xcode重新命名为xcode 7.3
,命令中xcode后面要跟一个'',表示后面的是空格跟xcode是一体的
2017/11/6 补充一种需要执行命令的情况
在运行报错,出现的情况与上面的一致
pod install
报错日志:
/Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/command.rb:129:in `verify_minimum_git_version!': [!] You need at least git version 1.8.5 to use CocoaPods (Pod::Informative)
from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/lib/cocoapods/command.rb:49:in `run'
from /Library/Ruby/Gems/2.3.0/gems/cocoapods-1.3.1/bin/pod:55:in `<top (required)>'
from /usr/local/bin/pod:22:in `load'
from /usr/local/bin/pod:22:in `<main>'