pod repo remove master pod repo add master https://code.aliyun.com/Magi/CocoaPods.git pod repo update
執行repo add
時報錯:[!] To setup the master specs repo, please run pod setup
ios
git clone https://gitclub.cn/CocoaPods/Specs.git ~/.cocoapods/repos/master pod repo update
測下來,阿里雲的源最快(ping值都在10ms左右,clone速度>300k),阿里雲加公鑰後可用ssh clone,下了5個G都只有52%,感受踩坑了,通常只有幾百兆到1個G
https://code.aliyun.com/Magi/CocoaPods.git
https://gitclub.cn/CocoaPods/Specs.git
https://git.coding.net/hging/Specs.gitgit
url = https://code.aliyun.com/Magi/CocoaPods.git
source 'https://code.aliyun.com/Magi/CocoaPods.git'
,不然仍是會從github更新,而且還會把設置好的源改回去!這點特別坑,我試了無數次。source 'https://code.aliyun.com/Magi/CocoaPods.git' platform :ios,'9.0' target 'TestIosObjectC' do pod 'SDAutoLayout' end
參考:《swift cocoapods配置》:這篇說的比較好,把我遇到的問題都覆蓋了github