美文网首页
pod search yourProject

pod search yourProject

作者: Steven054 | 来源:发表于2017-07-07 20:16 被阅读5次

操作步骤:

  • 准备工作
  1. 打tag(这一步不能少,后面.podspec文件会用到该版本号)
git tag ‘1.0.0’ 
git push –tags```

## 一、注册Trunk账户(邮箱地址建议写成github注册的邮箱,用户名写成github对应的用户名)

pod trunk register 邮箱地址 ‘用户名’ –verbose```

*注:注册命令执行完之后,对应的邮箱地址会收到一封邮件,“请确认您的注册CocoaPods通过点击以下链接:”,打开链接地址完成验证,如果地址不能点击就直接粘贴URL到浏览器上执行

二、查看自己的注册信息

 pod trunk me ```

![72C5DE82-B79B-42BD-B423-90681B3B23C4.png](https://img.haomeiwen.com/i2427734/4ef04d6c30b33e16.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

##三、新建.podspec文件,并提交.podspec文件到trunk中
- .podspec文件的作用是为了让CocoaPods搜索引擎知道该代码的作者、版本号、概要、描述、源代码地址、部署版本、依赖的框架等描述信息。 .podspec文件可以自动生成,但是因生成会生成很多没有用的信息,所以建议在github上找一个.podspec文件修改一下参数即可。

pod spec create MyProject // 生成MyProject.podspec文件

### vim MyProject.podspec 修改里面的内容如下:

s.name = "MyProject"
s.version = "1.0.0"(一定要和你提交的tag版本一致)
s.summary = "A fast integration images loop function of custom control"
s.description = "description your demo"
s.homepage = "https://github.com/MyProject"
s.social_media_url = "url"
s.license= { :type => "MIT", :file => "LICENSE" }
s.author = { "menday" => "shidewei054@163.com" }
s.source = { :git => "https://github.com/MyProject.git", :tag => s.version }
s.source_files = "MyProject/*.{h,m}"
s.ios.deployment_target = '6.0'
s.frameworks = 'UIKit'
s.requires_arc = true```

四、提交之前先验证.podspec文件是否合法

pod spec lint MyProject.podspec```

##五、 提交.podspec文件到trunk中

pod trunk push MyProject.podspec```

六、查找提交成功的库

pod search MyProject```

恭喜您安装成功了

相关文章

网友评论

      本文标题:pod search yourProject

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