美文网首页
pod创建私有库的打开方式

pod创建私有库的打开方式

作者: ask_ME | 来源:发表于2020-04-01 22:10 被阅读0次
cd pod  #进入创建库项目的文件夹
pod lib create PodLib  #创建PodLib库
填写库代码版本的相关信息.name填写你github的昵称.这样代码仓库地址就不需要修改了.
cd PodLib
pod lib lint  #验证你的PodLib.podspec文件是否填写正确,不正确可根据提示进行修改.
将库文件 .h .m放入PodLib/Classes中.
如果pod库有demo:
cd Example
pod update
这个时候在打开的工程项目中Pods/development pods可以看到库文件.

下面提交代码到仓库.
首先在你的github中创建一个仓库,仓库名PodLib,其他都不需要填写和选择,因为在上一步pod lib create PodLib已经帮我们配置好了这些信息.

git add .
git commit -m 'first commit'
git remote add origin https://github.com/askmegit/PodLib.git
git push origin master
# 添加版本号
git tag -m "first release" 0.1.0  #版本号和PodLib.podspec文件中版本号一致.
git push --tags     #推送tag到远端仓库

创建Pod私有仓库,github创建一个仓库podRepo.

pod repo add  podRepo https://github.com/askmegit/podRepo.git 
pod repo push podRepo PodLib.podspec

以上步骤成功后可以 pod search PodLib 到我们的仓库了.使用的时候配置下 podfile

source 'https://github.com/CocoaPods/Specs.git'  # 官方库
source 'https://git.coding.net/askme123/PodLib.git'  # 私有库

错误解决办法(Malformed version number string):
Malformed version number string

sudo gem update -n /usr/local/bin --system 2.7.6

参考
Pod 创建私有库之引用三方Framework和libs的配置方法
使用Cocoapods创建私有库
CocoaPods创建自己的公开库、私有库
iOS 建立自己本地cocoapod库

相关文章

网友评论

      本文标题:pod创建私有库的打开方式

      本文链接:https://www.haomeiwen.com/subject/ghucfqtx.html