1.概況
一般是第一次安裝cocoapod后, 使用pod install 或者 pod update等時(shí)候.
終端顯示
Cloning spec repo 'cocoapods' from 'https://github.com/CocoaPods/Specs.git'
就不動了,也沒個提示啥的,很迷
2.原因
一般來說其實(shí)是正在下載東西從github上,但是下載速度很慢
- 可以如下辦法查看進(jìn)度mac上找 活動監(jiān)視器里的網(wǎng)絡(luò)列表里找git-remote-https,這條即是當(dāng)前的下載進(jìn)度,可看到緩緩的在變動下載數(shù)據(jù)
- 何時(shí)下載完捏,這里可利用github的api查看下項(xiàng)目大小
https://api.github.com/repos/CocoaPods/Specs
這是github的api,返回一串json,是項(xiàng)目的相關(guān)信息.里面找size,即是項(xiàng)目大小,我看得750M多, so 耐心些等吧
3.解決辦法
更換國內(nèi)的鏡像, 清華的不錯
$ cd ~/.cocoapods/repos
$ pod repo remove master
$ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master
然后記得去自己項(xiàng)目podfile里把source換了
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
再重新pod update
但可能存在不最新的問題