我想通过
aab
创建Fastlane
(捆绑包),但到目前为止我只能创建apk
,现在这是我的lane
,如何创建aab?
lane :beta do
store_password = prompt(text: "Signing Store Password: ", secure_text: true)
key_password = prompt(text: "Alias Key Password: ", secure_text: true)
releaseFilePath = File.join(Dir.pwd, "..", "my-release-key.keystore")
gradle(task: 'clean')
gradle(
task: 'assemble',
build_type: 'Release',
print_command: false,
properties: {
"android.injected.signing.store.file" => releaseFilePath,
"android.injected.signing.store.password" => store_password,
"android.injected.signing.key.alias" => "my-key-alias",
"android.injected.signing.key.password" => key_password,
}
)
upload_to_play_store(
track: 'internal'
)
将
task
从 assemble
更改为 bundle
,解决了我的问题!
创建签名的 Android App Bundle(aab) 发布文件,然后发送到 Google Play 并自动发布到生产环境。
运行:fastlane build_aab --verbose
lane :build_aab do
gradle(task: 'clean')
gradle(
task: 'bundle',
build_type: 'Release',
print_command: true,
properties: {
"android.injected.signing.store.file" => "loca_file_system/store_file.jks",
"android.injected.signing.store.password" => "********",
"android.injected.signing.key.alias" => "your_signing_key",
"android.injected.signing.key.password" => "********",
}
)
upload_to_play_store(
track:'production',
skip_upload_metadata: true,
skip_upload_images: true,
skip_upload_screenshots: true)
end
在尝试构建 aab 文件之前,不要忘记运行 “fastlane Supply init” 并设置您的 Google Developers 服务帐户,否则无法与 google play console 连接。