ios project third-party library management tool pod

under

pod是mac下的第三方类库管理工具 类似于ubuntu的apt-get工具
这个工具可以帮助用户管理工程中引入的第三方类库 非常便捷
当在工程中需要引入比较大型的类库时 可能需要不断的编译引入类库的依赖 
使用pod却可以一步到位 让工具帮助我们做这个事情
比较遗憾的是pod仅在ios和mac开发里支持

Install

替换更新淘宝的ruby源(翻墙不便就用淘宝的源)
gem sources --remove https://rubygems.org/

安装命令:
sudo gem install cocoapods

Introduce third-party class libraries to the project

用法其实比较类似apt-get

首先搜索需要的库
pod search AFNetworking

然后在工程中创建Podfile(相当于Makefile)
platform :ios, '7.0'
        pod "AFNetworking", "~> 2.0"

在Podfile所在的目录 执行下载命令
pod install

Open an existing project

打开已存在的工程的话 需要使用pod更新下载项目依赖的第三方类库
pod update

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324775813&siteId=291194637