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