在上文中提到如果找不到相对应的缓存,其实还有一种“曲线救国”的办法:
1、使用国内CocoaPods镜像源,这里推荐gitee,使用以下命令添加源:
pod repo add gitee https://gitee.com/mirrors/CocoaPods-Specs.git
等待添加之后,验证是否添加成功:
pod repo list
2、Podfile文件中指定source参数
source 'https://gitee.com/mirrors/CocoaPods-Specs.git'
# source 'https://github.com/CocoaPods/Specs.git'
并且添加需要引入的第三方库,执行pod install
如果安装的第三方库版本比较新,建议在
pod install之前先更新gitee repopod repo update gitee
3、等待安装成功,就有相关版本的缓存了,如果没有特殊阻力,建议直接使用gitee源~