Cocoaspod

2015-12-31  本文已影响485人  gpr

CocoaPods

安装


// 刚开始可能是这样的
*** CURRENT SOURCES ***

https://rubygems.org/

默认repo :https://github.com/CocoaPods/Specs.git

// 中间会有一堆信息
......
Parsing documentation for open4-1.3.4
Installing ri documentation for open4-1.3.4
Parsing documentation for cocoapods-0.35.0
Installing ri documentation for cocoapods-0.35.0
20 gems installed
platform :ios, '8.0'
pod 'UIView+AutoLayout', '~> 2.0'
pod 'MJExtension'

项目上传注意事项

上传项目到服务器中注意一定要上传两个文件,Pod文件夹不要上传,因为下次使用的时候就直接解析 Podfile 和 根据 Podfile.lock 下载对应的版本
* Podfile           // 它记录了项目所依赖的框架信息
* Podfile.lock      // 它记录了当前框架所依赖一些框架的版本号

升级

$ sudo gem update --system // 先更新gem,国内需要切换源
$ gem sources --remove https://rubygems.org/
$ gem sources -a http://ruby.taobao.org/
$ gem sources -l
\*\*\* CURRENT SOURCES \*\*\*
http://ruby.taobao.org/
$ sudo gem install cocoapods // 安装cocoapods
$ pod setup

更换本地仓库

gitcafe: https://gitcafe.com/akuandev/Specs.git
pod repo remove master
pod repo add master http://git.oschina.net/akuandev/Specs.git
pod repo update

# python -m SimpleHTTPServer
# pod update --verbose --no-repo-update
# ifconfig 

gitcafe: https://gitcafe.com/akuandev/Specs.git

oschina: http://git.oschina.net/akuandev/Specs.git

// 例子如下
gem install cocoapods -v 0.38.2
gem uninstall cocoapods -v 0.39.0
上一篇 下一篇

猜你喜欢

热点阅读