检查 CocoaPods 版本```shell
pod —version
更新镜像地址
<a name="4j045"></a>
### CocoaPods 版本 < 1.9
```shell
pod repo remove master // 移除master源
pod repo add master https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git // 添加清华源
pod repo update // 更新资源库
CocoaPods 版本 >= 1.9
cd ~/.cocoapods/repos // 进入pods资源库
pod repo remove master // 移除master源
git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master // 克隆清华源
项目指定源
最后进入自己的工程,在自己工程的Podfile
第一行加上:
//==> ios/Podfile
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'