美文网首页
iOS 卡住在 Cloning spec repo 'cocoa

iOS 卡住在 Cloning spec repo 'cocoa

作者: leonStep | 来源:发表于2020-05-20 17:07 被阅读0次

    1.概况

    一般是第一次安装cocoapod后, 使用pod install 或者 pod update等时候.
    终端显示

    Cloning spec repo 'cocoapods' from 'https://github.com/CocoaPods/Specs.git'
    

    1
    就不动了,也没个提示啥的,很迷

    2.原因

    一般来说其实是正在下载东西从github上,但是下载速度很慢

    可以如下办法查看进度mac上找 活动监视器里的网络列表里找git-remote-https,这条即是当前的下载进度,可看到缓缓的在变动下载数据
    何时下载完捏,这里可利用github的api查看下项目大小
    https://api.github.com/repos/CocoaPods/Specs
    这是github的api,返回一串json,是项目的相关信息.里面找size,即是项目大小,我看得750M多, so 耐心些等吧
    3.解决办法

    更换国内的镜像, 清华的不错

    $ cd ~/.cocoapods/repos 
    $ pod repo remove master
    $ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master
    

    然后记得去自己项目podfile里把source换了

    source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
    

    1
    然后再重新pod update
    但可能存在不最新的问题
    ————————————————

    原文链接:https://blog.csdn.net/RollingPin/java/article/details/105050897

    相关文章

      网友评论

          本文标题:iOS 卡住在 Cloning spec repo 'cocoa

          本文链接:https://www.haomeiwen.com/subject/zppnohtx.html