Cocoapods的repo库时不时需要跟新,但是速度很慢,在国内的网络状况下,使用官方方法进行repo的创建或是更新都是非常慢的,我们通过git将它clone下来,再更新就快很多。
打开终端,执行以下命令:
cd /Users/[你的用户名]/.cocoapods/repos
git clone git@github.com:CocoaPods/Specs.git
pod setup
setup的时候网不好会出现错误
unable to access 'https://github.com/CocoaPods/Specs.git/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
Setting up CocoaPods master repo
$ /usr/local/bin/git clone https://github.com/CocoaPods/Specs.git master
--progress
Cloning into 'master'...
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
[!] /usr/local/bin/git clone https://github.com/CocoaPods/Specs.git master --progress
Cloning into 'master'...
fatal: unable to access 'https://github.com/CocoaPods/Specs.git/': LibreSSL SSL_read: SSL_ERROR_SYSCALL, errno 60
我们可以把电脑连上手机热点,再次执行pod setup
,下载速度可以达到 1.5MiB/s—3MiB/s,速度快到飞起来。