命令
$ pod trunk register orta@cocoapods.org 'Orta Therox' --description='macbook air'
orta@cocoapods.org修改为自己的邮箱
'Orta Therox' ``修改为随意命名
--description='macbook air' ``可以不改``也可以修改为``--verbose (``修改为``—verbose``执行命令会有提示``)
修改后的命令pod trunk register 18607304107@163.com 'rgDream' –verbose
执行命令后会提示邮箱认证

进入邮箱

找到链接, 浏览器里面访问链接, 就会提示已验证,然后可以回到终端
1.3 执行下面命令 将podspec文件推到远程仓库
pod trunk push TESTComponentize.podspec --allow-warnings
然后等待下载
push报错处理方案
[!] CocoaPods was not able to update the master
repo. If this is an unexpected issue and persists you can inspect it running `pod repo update --verbose

解决方法更新本地库: pod repo update --verbose
成功之后,会有如下打印

此时 执行
pod search TESTComponentize
可能会搜索不到,如果搜索不到则执行下面两不,更新本地索引库
删除本地CocoaPods 的 search_index.json
cd /Users/dream/Library/Caches/CocoaPods
- 执行 pod steup
至此, 组件就上传到cocoapods, 并支持cocoapods下载
一些注意点:
1.终端执行命令: pod repo 可以看到如下打印
远程索引库可以包含了所有cocoapods的项目索引
本地索引库包含了当前pod版本的项目索引

注意: 如果网速慢时,pod trunk push 会push不成功,可以重新执行此命令
网友评论