iOS 发布自己的pod到cocoapods上
2020-12-02 本文已影响0人
MonKey_Money
前沿
首先mac上面要安装cocoapods和git
1.注册
pod trunk register [********@****.com](用户邮箱) '*****'(用户名) --verbose
2.查看注册信息
pod trunk me
![](https://img.haomeiwen.com/i11530417/9dbf2e870990d711.png)
3.创建模版
pod lib create xxxxx
完成后的文件路径
![](https://img.haomeiwen.com/i11530417/38c3a9c24a16d10e.png)
4.github创建项目并关联
github上面创建项目就不在复述了。
git remote add origin git@github.com:ioswangpengwei/PWGCDTimer.git
5.在class文件夹下放入你的文件
![](https://img.haomeiwen.com/i11530417/d00179af149e8fdc.png)
![](https://img.haomeiwen.com/i11530417/2f72d755d7cd718a.png)
6.编辑podspec文件
![](https://img.haomeiwen.com/i11530417/d39ec6d3e39c7723.png)
source建议写https的URL
7.更新本地的修改到远程
git add .
git commit -m “描述”
git push origin master
8.给工程打tag
git tag -a 0.1.0 -m "描述"
git push origin 0.1.0
//删除本地tag
git tag -d 0.1.0
//删除远程tag
git push origin :refs/tags/tag-name
8.验证.podspec文件
pod lib lint
pod trunk push ZQExtension.podspec
出现下面的信息,说明成功
![](https://img.haomeiwen.com/i11530417/2d2a9e197418eb21.png)
9.查找自己的cocoapods库
//更新repo库
pod repo update
//删除cocoapods的search缓存
rm ~/Library/Caches/CocoaPods/search_index.json
//查找cocoapods库
pod search PWGCDTimer
![](https://img.haomeiwen.com/i11530417/f86f199a169dddc8.png)