cocoapods快速安装法

1、开启 terminal(终端)

2、移除现有 Ruby 默认源

$ gem sources --add https://gems.ruby-china.org/ --remove https://rubygems.org/          #(淘宝不更新了)

$ gem sources -l  

3、更新 gem

$ sudo gem update --system

4、安装 CocoaPods

$ sudo gem install -n /usr/local/bin cocoapods   #(OS X 10.11以上,OS X 10.11以下:$ sudo gem install cocoapods)

$ pod search

$ git clone https://git.coding.net/CocoaPods/Specs.git ~/.cocoapods/repos/master 

$ pod repo update

$ pod repo

$ pod setup

5、编辑 Podfile文件,并写入要添加的第三方库

platform:ios, '8.0'

pod 'AFNetworking', '~> 2.3.1'<-------第三方

6、导入第三方库

$ pod install

7、退出终端

猜你喜欢

转载自blog.csdn.net/qq_22042107/article/details/71248758