iOS-cocoapods 使用

cocoapods 导入项目

(写入以下内容并保存 小提示:终端vim文件 按 i 可编辑 ,esc 退出编辑, :wq  可保存退出)

vim Podfile

platform :ios, ‘8.1’
use_frameworks!
target 'oc_xx' do
pod 'SDWebImage', '~>3.8'
end

$ pod install
pod install --verbose --no-repo-update     更快
end
pod update  --no-repo-update  更新 

swift---

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
use_frameworks!

target “xxx” do
    pod 'SnapKit', '~> 3.2.0'
end


查询第三方  $ pod search  SDWebImage


更新版本到最新
pod install --repo-update
查询版本
pod --version

安装最新版本的cocoapods(更新到最新版)
https://www.cnblogs.com/henusyj-1314/p/6669735.html

不检查CocoaPods specs更新
https://www.jianshu.com/p/943127d0be4c

Setting up CocoaPods Master repo 很慢的解决方法
https://www.jianshu.com/p/40b294f713c2

cocoapods 安装

https://www.jianshu.com/p/ab6411a05bc2

cocoapods 出错

http://www.ithao123.cn/content-7930264.html
http://blog.csdn.net/sjl_leaf/article/details/50506057

修复  Swap file ".podfile.swp" already exists!

https://www.jianshu.com/p/dec1bed7a0b6
https://blog.csdn.net/zhengxiangwen/article/details/50631720

修复  out-of-date source repos which you can update with pod repo update.

pod setup 执行

https://www.jianshu.com/p/fe5787144792


修复cocoapods - Unable to satisfy the following requirements:

解决方法:删除本地缓存,重新setup
$  rm -fr ~/.cocoapods/repos/master
$  pod setup

iOS 最新版 CocoaPods 的安装流程

https://www.jianshu.com/p/4a3d9cc2ecfc

$ gem --version (查看gem版本)

1.移除现有Ruby默认源          $  gem sources --remove https://rubygems.org/

2.使用新的源                 $  gem sources -a https://ruby.taobao.org/
     
3.验证新源是否替换成功        $gem sources -l

4.安装CocoaPods

  (1) $sudo gem install cocoapods           备注:苹果系统升级 OS X EL Capitan 后改为 $sudo gem install -n /usr/local/bin cocoapods
  (2) $pod setup

5.更新gem                           $sudo gem update --system

6. 新建工程,并在终端用  cd  文件拖到控制台     最后是     bogon:~ ibokan$ cd /Users/ibokan/Desktop/kk

http://blog.devtang.com/2014/05/25/use-cocoapod-to-manage-ios-lib-dependency/
http://blog.csdn.net/sjl_leaf/article/details/50506057
http://www.jianshu.com/p/fe5787144792

iOS-cocoapods 使用_第1张图片
image.png

你可能感兴趣的:(iOS-cocoapods 使用)