iOS 制作共有pod库

·  阅读 112
iOS 制作共有pod库

1.在github 上新建一个repository

1.png

2.在本机cd到存放这个库的文件夹下,终端输入pod lib create ShawPodDemo

3.创建pod会问几个问题,我这里是用OC写的代码,后续制作与Swift稍有不同,根据自己情况填写即可。

22.png

4.创建完毕之后,会自动创建一个ShawPodDemo文件夹,里面有pod的相关信息,并且自动打开此project。

5.修改ShawPodDemo.podspec文件

444.png

6.ok到这一步 .podspec文件就配置完成了 7.验证本地.podspec 文件的有效性 输入命令: $pod lib lint ShawPodDemo.podspec

-> ShawPodDemo (0.1.0) - WARN | url: The URL (github.com/mr-show-201…) is not reachable.

[!] ShawPodDemo did not pass validation, due to 1 warning (but you can use --allow-warnings to ignore it) and all results apply only to public specs, but you can use --private to ignore them if linting the specification for a private pod. You can use the --no-clean option to inspect any issue.

8.如果有 Error这需要更改 error。如果有 warning, 但有不改正需要执行下面的命令:
$ pod lib lint ShawPodDemo.podspec --allow-warnings

9.如果提示:[!] You need to run pod trunk register to register a session first. 那么在输入:pod trunk register 'XXXo@sina.cn' 'name' 直接输入 pod trunk register 'XXXo@sina.cn' 会提示[!] {"name"=>["is not present"]} 然后去邮箱进行确认! 10.再次执行 $pod lib lint ShawPodDemo.podspec 正常执行结果为:

Cloning spec repo ShawPodDemo from https://github.com/mr-show-2017/ShawPodDemo.git

分类:
iOS
标签:
分类:
iOS
标签:
收藏成功!
已添加到「」, 点击更改