1.fastlane配置
1.安装
sudo gem install fastlane -NV
fastlane init
2. Appfile配置
app_identifier("") # The bundle identifier of your app
apple_id("") # Your Apple email address
team_id("") # Developer Portal Team ID
3. Fastfile配置
# update_fastlane(nightly: true)
default_platform(:ios)
# 蒲公英api_key和user_key
pgyer_apiKey = ""
pgyer_userkey = ""
platform :ios do
scheme_name = ""
desc "打包并上传firm"
lane :fir do
adhoc
# firim(firim_api_token: "",app_release_type:"adhoc")
puts "*************| 开始上传蒲公英... |*************"
# 开始上传蒲公英
pgyer(api_key: "#{pgyer_apiKey}", user_key: "#{pgyer_userkey}")
puts "*************| 上传蒲公英成功🎉 |*************"
end
desc "打包并上传appStore"
lane :apple do
appleIpa
appleDeliver
end
desc "ipa打包"
lane :adhoc do
sigh(adhoc: true)
gym(
scheme: scheme_name,
workspace: "#{scheme_name}.xcworkspace",
configuration: "Release",
clean: true,
include_bitcode: false,
export_method: "ad-hoc",
output_name:"#{scheme_name}_Adhoc.ipa",
output_directory:"./fastlane/ipa", # 打包后的 ipa 文件存放的目录
# increment_build_number:true
)# app-store, ad-hoc, package, enterprise, development, developer-id#
#使用自动证书管理
disable_automatic_code_signing(path: "#{scheme_name}.xcodeproj")
notification(subtitle: "Finished Building", message: "Ready to upload...")
end
desc "构建AppStore版本"
lane :appleIpa do
sigh(
username: 'appid',
app_identifier: '',
force: false,
provisioning_name: '',
ignore_profiles_with_different_name: true,
)
gym(
scheme: scheme_name,
workspace: "#{scheme_name}.xcworkspace",
configuration: "Release",
clean: true,
include_bitcode: false,
export_method: "app-store",
output_name:"#{scheme_name}_AppStore.ipa",
output_directory:"./fastlane/ipa", # 打包后的 ipa 文件存放的目录
)
end
desc "上传AppStore版本"
lane :appleDeliver do
deliver(
submit_for_review: false,
force: true,
ignore_language_directory_validation:true,
)
end
end
2.蒲公英配置
1.安装
fastlane add_plugin pgyer
2.命令行配置
puts "*************| 开始上传蒲公英... |*************"
# 开始上传蒲公英
pgyer(api_key: "#{pgyer_apiKey}", user_key: "#{pgyer_userkey}")
puts "*************| 上传蒲公英成功🎉 |*************"
3.fir.im配置(新域名 https://www.betaqr.com/)
fastlane add_plugin firim
platform:平台 iOS/Android
firim_api_token :API Token
firim_username,
ipa,
apk,
gradle_file,
icon,
file,
app_identifier,
app_name,
app_desc,
app_short,
app_is_opened :外部访问权限
app_is_show_plaza,
app_passwd :下载密码
app_store_link_visible : appstore链接
app_version : Version
app_build_version : build Version
app_release_type:release类型
app_changelog,
app_info_to_file_path
问题记录
1.gem install ERROR: Failed to build gem native extension
解决指令
rvm reset
rvm list
rvm use [本机可用ruby版本号]
重新执行 fastlane 安装操作
2.经过1的解决方案后,每次重启终端,都需要rvm use 版本号,暂无解决办法。
网友评论