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