CocoaPods 全局概览

194 阅读1分钟

思维导图:

企业微信截图_d4ecb5b2-e5d5-4114-a45f-cbc6c78a800e.png

一、使用

podfile //描述依赖文件

pod 'AwesomeView', :path => '/Users/AwesomeView' //库本地调试设置

pod install vs. pod update //安装和更新

二、涉及文件

Podfile

Podspec

三、私有库制作

1、制作代码库,包含podspec文件

pod lib create MyLibrary //创建模版库即创建代码库及spec文件:  

  
pod spec create 文件名称 //或者单独创建podspec文件:

2、制作版本库repo

git init; git push //1.创建远程私有仓库

pod repo add MySpecRepo https://git.abc/MySpecRepo.git //2.将这个远程的私有版本仓库添加到本地:

3、将代码库中的podspec文件,推送到版本库

pod repo push MySpecRepo xxxx.podspec //将描述文件podspec推送到私有SpecRepo版本库中

具体过程分以下几步

1> 验证 xxxx.podspec 文件

2> 拉取远程版本库 MySpecRepo

3> 添加 xxxx.podspec 到版本库中

4> push 到远程