fastlane自动打包上传蒲公英
2021-02-04 本文已影响0人
MeteorCode
默认已安装Xcode;
安装fastlane
sudo gem install fastlane --verbose
-
安装完成
成功
使用命令查看安装的版本号:
fastlane --version
配置项目
- 进入到工程目录下,执行
fastlane init
,生成Appfile
和Fastfile
文件
fastlane init
- 配置
Appfile
app_identifier("com.xxxx.xxx") //项目bundleID
apple_id("xxx@qq.com") //邮箱
team_id "xxx" //证书team ID
- 配置
Fastfile
,以蒲公英为例;
platform :iOS do
desc "Push a new release build to the pgyer"
# ----------------------- 打包内测.ipa文件 -----------------------
lane :pgyerUp do
puts "*************| 开始打包.ipa到蒲公英... |*************"
# 更新项目build号
#updateProjectBuildNumber
# 开始打包
gym(
# 项目信息
output_name:"xxx.ipa",
scheme:"xxx",
workspace: "xxx.xcworkspace",
# 是否清空以前的编译信息 true:是
clean:true,
# 指定打包方式,Release 或者 Debug
configuration:"Release",
# 指定输出文件夹 xxx.ipa
output_directory:"/Users/xxx/Documents/demo",
# Xcode9将不会允许你访问钥匙串里的内容,除非设置allowProvisioningUpdates
export_xcargs:"-allowProvisioningUpdates",
# 隐藏没有必要的信息
silent:true,
# 指定打包方式,目前支持app-store, package, ad-hoc, enterprise, development
# 注:由于使用手动配置证书,在export_options指定打包方式
export_method:"development",
# 手动配置证书,注意打包方式需在export_options内使用method设置,不可使用export_method
# export_options: {
# method:"development",
# provisioningProfiles: {
# # "boundleId":"描述文件名称"
# "com.xxxx.xxxx":"development_profile"
# },
# signingStyle: "manual"
# }
)
puts "*************| 开始上传蒲公英... |*************"
# 蒲公英的key
pgyer(api_key: "xxx", user_key:"xxx")
puts "*************| 上传蒲公英成功🎉 |*************"
end
end
蒲公英
在工程目录下
- 安装蒲公英插件
fastlane add_plugin pgyer
第一次安装提示选择3
[16:17:00]: Seems like the plugin is not available on RubyGems, what do you want to do?
1. Git URL
2. Local Path
3. RubyGems.org ('fastlane-plugin-pgyer' seems to not be available there)
4. Other Gem Server
? 3


- 打包上传到蒲公英
fastlane pgyerUp
