iOS Fastlane一键打包上传蒲公英

蒲公英官方文档

前提条件

已经安装好 ruby、rubygems、bundler

已经安装了 Fastlane。如果没有安装,请参考FastLane

第一步

fastlane add_plugin pgyer

第二布

在使用 Fastlane 之前,我们首先需要在项目中初始化 Fastlane。首先进入 App 的开发目录,执行以下命令来初始化 Fastlane:

fastlane init

第三步

vim ./fastlane/Fastfile

第四步

lane :beta do
  build_app(export_method: "ad-hoc")
  pgyer(api_key: "7f15xxxxxxxxxxxxxxxxxx141", user_key: "4a5bcxxxxxxxxxxxxxxx3a9e")
end
  1. 以上的 api_keyuser_key,请开发者在自己账号下的 应用管理 - App概述 - API 中可以找到,并替换到以上相应的位置。
  2. 在 Xcode 8.3 和 Xcode 8.3 以后的版本中,对于 build_appexport_method 的值,需要根据开发者的打包类型进行设置,可选的值有:app-storead-hocdevelopmententerprise。对于 Xcode 8.3 以下的版本,则不需要设置 export_method

第五步

经过以上配置后,就可以使用 Fastlane 来打包 App,并自动上传到蒲公英了。在终端下,定位到项目所在目录,输入以下命令即可:

fastlane beta
然后会打印很长的log日志,打包、上传之后成功。

如果有多个target,会有一个选择,输入对应的序号即可继续

Select Scheme: 
1. VenueLeague
2. VenueLeagueUITests
? 

上传完成,9分钟,可以说是很快了

[10:41:18]: Start upload /Users/soulkey/Desktop/Pro/stadium-aliance-app-ios/VenueLeague/VenueLeague.ipa to pgyer...
[10:46:31]: Upload success. Visit this URL to see: https://www.pgyer.com/6vEU

+------+------------------+-------------+
|           fastlane summary            |
+------+------------------+-------------+
| Step | Action           | Time (in s) |
+------+------------------+-------------+
| 1    | default_platform | 0           |
| 2    | build_app        | 235         |
| 3    | pgyer            | 313         |
+------+------------------+-------------+

[10:46:31]: fastlane.tools just saved you 9 minutes! 🎉

备注:

如果报这个错

[15:35:06]: RubyGems is not listed as your Gem source
[15:35:06]: You can run `gem sources` to see all your sources
[15:35:06]: Please run the following command to fix this:
[15:35:06]: $ gem sources --add https://rubygems.org

查看当前

gem sources

添加源

gem sources --add https://rubygems.org

然后gem sources查看确认一下是否添加成功,问题解决

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值