首页 > 其他分享 >pod install–verbose 出错 仓库拉不下来 https://github.com/CocoaPods/Specs.git

pod install–verbose 出错 仓库拉不下来 https://github.com/CocoaPods/Specs.git

时间:2023-03-01 12:55:29浏览次数:52  
标签:git verbose CocoaPods cocoapods https com Specs

发布过unity+admob iOS包的开发者应该都有体会,构建版本时unity会很长时间卡在pod install这个过程中,特别是在第一次执行构建xcode项目时,可能整个过程耗时要一个下午!

在这个过程中它会把 https://github.com/CocoaPods/Specs.git 克隆到本地 ~/.cocoapods/repos 的某个目录下,类似执行以下命令:

cd ~/.cocoapods/repos
git clone https://github.com/CocoaPods/Specs.git master  ## 把仓库克隆到master目录中

想要加快构建速度,可以把该仓库事先离线下载。

 

方法一:用国内镜像地址 ​https://gitee.com/mirrors/CocoaPods-Specs​​ 来下来,然后再关联到 https://github.com/CocoaPods/Specs.git 

cd ~/.cocoapods/repos
git clone ​https://gitee.com/mirrors/CocoaPods-Specs​​ master

等待下载完毕后,进行关联仓库:

$ cd master
$ git init   ## git 初始化
Initialized empty Git repository in /Users/xxx/.cocoapods/repos/cocoapods/.git/  ## git init 命令输出结果
$ ​​​git remote add origin https://github.com/CocoaPods/Specs​​   ## 关联仓库

查看仓库关联结果,打开~/.cocoapods/repos/master/.git/config 文件:
31021631_629509ff3162e86067
猜测国内镜像内容与国外内容应该是一样的,版本应该是一致的。若不一致,会不会导致其他问题?好在国内镜像地址下载速度快,几分钟就可以验证结果!

 

方法二:科(XUE)上[WANG]下载 https://github.com/CocoaPods/Specs.git  

cd ~/.cocoapods/repos
git clone https://github.com/CocoaPods/Specs.git master  ## 把仓库克隆到master目录中

方法三:从其他电脑拷贝或者用其他途径下载下来,放置到 ~/.cocoapods/repos 目录下
31021630_629509fedab1e30193

cd ~/.cocoapods/repos
zip -r master.zip master   ## 压缩文件夹
unzip master.zip   ## 解压文件

 

疑问:~/.cocoapods/repos 目录下还有个 名为Spec_Lock 大小为0的文件,需要手都创建么?

vim Spec_Lock
:wq!

 

参考以及感谢网友的无私奉献:
https://blog.51cto.com/jinbeen/5346205
https://wpbeaches.com/how-to-compress-and-uncompress-files-and-folders-in-the-terminal-in-macos-big-sur/

标签:git,verbose,CocoaPods,cocoapods,https,com,Specs
From: https://www.cnblogs.com/open-coder/p/17167778.html

相关文章