美文网首页Pod、carthage库、brew管理iOS
CocoaPods切换为清华的镜像源

CocoaPods切换为清华的镜像源

作者: ZT_Story | 来源:发表于2019-12-18 09:59 被阅读0次

CocoaPods 是一个 Cocoa 和 Cocoa Touch 框架的依赖管理器,具体原理和 Homebrew 有点类似,都是从 GitHub 下载索引,然后根据索引下载依赖的源代码。
对于旧版的 CocoaPods(1.3以前) 可以使用如下方法使用 tuna 的镜像:

$ pod repo remove master
$ pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
$ pod repo update

新版的 CocoaPods (1.3以后)不允许用pod repo add直接添加master库了,但是依然可以:

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

最后进入自己的工程,在自己工程的podFile第一行加上:

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

参考:CocoaPods 镜像使用帮助——清华大学开源软件镜像站

相关文章

网友评论

    本文标题:CocoaPods切换为清华的镜像源

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