Cocoapods的安装与基本使用

27. January 2016 Swift 0

iOS 最新版 CocoaPods 的安装流程

1.移除现有Ruby默认源

$gem sources –remove https://rubygems.org/

2.使用新的源

$gem sources -a https://ruby.taobao.org/

3.验证新源是否替换成功

$gem sources -l

4.安装CocoaPods

$sudo gem install cocoapods 备注:苹果系统升级 OS X EL Capitan

后改为 $sudo gem install -n /usr/local/bin cocoapods

5. 新建工程,并在终端用cd指令到项目文件夹中,然后记得关闭工程
6.新建文件 vim “Podfile”,

$ vim Podfile

platform :ios, '8.0'
use_frameworks!

target 'MyApp' do
  pod 'AFNetworking', '~> 2.6'
  pod 'ORStackView', '~> 3.0'
  pod 'SwiftyJSON', '~> 2.3'
end

7.导入第三方库

$pod install

完成后打开项目文件夹中的.xcworkspace ,就可以在Xcode看到了
几个挺详细,不错的网站哦,关于cocoapods的安装
http://www.bubuko.com/infodetail-425274.html
http://blog.csdn.net/zhu410289616/article/details/44986351
http://blog.csdn.net/showhilllee/article/details/38398119
http://www.tuicool.com/articles/7VvuAr3

Leave a Reply

Your email address will not be published. Required fields are marked *