1 pod 查看当前源
$ pod repo
0 repos
2 pod repo换源
CocoaPods 镜像使用帮助
CocoaPods 是一个 Cocoa 和 Cocoa Touch 框架的依赖管理器,具体原理和 Homebrew 有点类似,都是从 GitHub 下载索引,然后根据索引下载依赖的源代码。
- 对于旧版的 CocoaPods 可以使用如下方法使用 tuna 的镜像:
1 $ pod repo remove master
2 $ pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
3 $ pod repo update
- 新版的 CocoaPods 不允许用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'
会出现以下的字眼(这里我已经换源了,本来是来自github的源)
master
- Type: git (master)
- URL: https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
- Path: /Users/iMac/.cocoapods/repos/master
1 repo
碎碎念:
1.我是在~/.cocoapods/repos目录下执行 pod setup来安装Pods的
2..cocoapods/repos是自己新建的
3.下载地址:
https://github.com/CocoaPods/Specs.git --progress -- master
3.为什么不和原文保持一致呢?因为我在尝试用
pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git
这个命令来安装镜像时,报错了。提示使用pod setup安装的:
---------------------
参考了:https://blog.csdn.net/u010828718/article/details/84068441