1. 安装Homebrew
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
2. 使用Homebrew安装cocoapods
brew install cocoapods
3. 设置cocoapods
pod setup
4. 下载索引库
git clone https://github.com/CocoaPods/Specs.git ~/.cocoapods/repos/master
下载失败的话就到国内镜像仓库手动下载:
https://gitee.com/Cocoapods-Wand/gitee-cocoapods
或者修改下载地址:
git clone https://gitee.com/Cocoapods-Wand/gitee-cocoapods ~/.cocoapods/repos/master
5. 修改master/.git/config文件配置
远程仓库地址为:
https://github.com/CocoaPods/Specs.git
6. 更新本地索引确保同步到最新索引库
pod repo update --verbose
搜索第三方尝试:
pod search Alamofire