最近使用CocoaPods來添加第三方類庫,無論是執行pod install還是pod update都卡在了Analyzing dependencies不動
原因在于當執行以上兩個命令的時候會升級CocoaPods的spec倉庫,加一個參數可以省略這一步,然后速度就會提升不少。加參數的命令如下:
pod install --verbose --no-repo-update
pod update --verbose --no-repo-update
下面是瞎折騰過程。。。。
因為最近cocoaPods更新到1.0.0,導致了原先項目的pod 環境無法使用,然后就pod install出現各種cocoapod連環錯誤,總結一下。
1.0.0以后要保證 pod file 格式如下
platform :ios,'7.0'#手機的系統
use_frameworks!
target'ChangShiAction'do
pod'AFNetworking','~> 3.0'
end
1.因為國內淘寶源以及已經不再維護了,所以首先要替換gem 源
$gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/
$gem sources -lhttps://gems.ruby-china.org
# 確保只有 gems.ruby-china.org
2.替換pod 源為國內托管源
pod repo remove master
//coding 上有每日更新的,建議使用這個pod repo add master https://git.coding.net/CocoaPods/Specs.git
出現 [!] To setup the master specs repo, please run `pod setup`. 錯誤 執行下面命令 開始漫長等待
$ cd ~/.cocoapods/repos
$ git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master
3.最后 pod setup (還要等 ??)?
結束,大功告成。
快去試試pod 第三方庫速度有沒有提升