一、下载:首先,github 的repo库下载太慢,且经常失败,所以从以下地址下载:
https://code.aliyun.com/Magi/CocoaPods.git
https://gitclub.cn/CocoaPods/Specs.git
https://git.coding.net/CocoaPods/Specs.git(已经停止更新,但亲测可用)
二、将解压后的master文件夹(如果名称不叫master,改成master),放入~/.cocoapods/repo文件夹下,文件结构如图:
image.png
三、配置:终端
cd ~/.cocoapods/repos/master
然后初始化
git init
添加origin
git remote add origin https://github.com/CocoaPods/Specs
,检查一下
pod repo
image.png
四、后面就是创建Podfile
五、pod install --no-repo-update
image.png