pod setup
其实在你安装CocoaPods执行pod install
时,系统会默认操作pod setup
,然而由于中国强大的墙可能会pod setup不成功。这时就需要手动执行pod setup
指令,如下:终端输入:pod setup
会出现Setting up CocoaPods master repo
,稍等几十秒,最底下会输出Setup completed
。说明执行pod setup
成功。如果pod search操作还是搜索失败,如下:终端输入:pod search AFNetworking
输出:Unable to find a pod with name, author, summary, or descriptionmatching 'AFNetworking'
这时就需要继续下面的步骤了。删除~/Library/Caches/CocoaPods目录下的search_index.json文件pod setup
成功后,依然不能pod search
,是因为之前你执行pod search
生成了search_index.json,此时需要删掉。终端输入:rm ~/Library/Caches/CocoaPods/search_index.json删除成功后,再执行pod search
。执行pod search
终端输入:pod search afnetworking
(不区分大小写)输出:Creating search index for spec repo 'master'.. Done!
,稍等片刻······就会出现所有带有afnetworking字段的类库新闻热点
疑难解答