Azure devops 管道构建和部署我的本地 Android 应用程序 Google Play 商店或 App Center 作为 App Bundle
Azure devops pipeline to build and deploy my native Android application Google Play store or App Center as App Bundle
我需要设置 Azure 一个 devops 管道来构建我的原生 Android 应用程序并将其部署到 Google Play 商店或 App Center 作为 App Bundle。
我可以想办法部署 apk,但需要帮助来部署应用程序包 (.aab)。任何帮助将不胜感激。
您可以使用 Google Play - Release Bundle 任务来部署应用程序包 (.aab)。在您的 azure devops 组织中安装 Google play extension 之后。您可以在管道中添加 Google Play - Release Bundle 任务,并将 bundleFile
字段配置到生成的 .aab bundleFile 的位置。见下文。
- task: ms-vsclient.google-play.google-play-release-bundle.GooglePlayReleaseBundle@3
displayName: 'Release functionParam.ps1 to internal'
inputs:
serviceConnection: googleServiceEndPoint
applicationId: applicationId
bundleFile: **/*.aab
查看下面的教程,为您的 Android 应用程序创建管道
Build, test, and deploy Android apps
更新:
您可以在 Azure 管道中使用 jarsigner
命令签署 aab 包。您可能需要使用 download secure file task to use your keystore_file if you upload it to secure file。例如 运行 在 powershell 任务中的 jarsigner 命令下面:
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore my_keystor_file.keystore -storepass 'super_secret_keystore_pass' -keypass 'super_secret_alias_password' my-app-bundle.aab myKeyStoreAlias
有关详细信息,请参阅 。
您还可以使用 Xamarin.Android 构建任务。并在 Additional arguments for the build 中传递以下参数以打包和签署 App Bundle:
-restore -t:SignAndroidPackage -p:AndroidPackageFormat=aab -p:AndroidKeyStore=True -p:AndroidSigningKeyStore=$(keystore.secureFilePath) -p:AndroidSigningStorePass=$(KeystorePassword) -p:AndroidSigningKeyAlias=$(KeystoreAlias) -p:AndroidSigningKeyPass=$(KeystorePassword)
有关详细信息,请参阅 here。
将 apkFiles 更改为 **/*.aab
并传递算法,-sigalg SHA256withRSA -digestalg SHA-256
作为 jarsignerArguments。
像这样:
- task: AndroidSigning@2
inputs:
apkFiles: '**/*.aab'
jarsign: true
jarsignerKeystoreFile: 'pathToYourKeystoreFile'
jarsignerKeystorePassword: '$(jarsignerKeystorePassword)'
jarsignerKeystoreAlias: '$(yourKeystoreAlias)'
jarsignerKeyPassword: '$(jarsignerKeyPassword)'
jarsignerArguments: '-sigalg SHA256withRSA -digestalg SHA-256'
zipalign: true
我需要设置 Azure 一个 devops 管道来构建我的原生 Android 应用程序并将其部署到 Google Play 商店或 App Center 作为 App Bundle。
我可以想办法部署 apk,但需要帮助来部署应用程序包 (.aab)。任何帮助将不胜感激。
您可以使用 Google Play - Release Bundle 任务来部署应用程序包 (.aab)。在您的 azure devops 组织中安装 Google play extension 之后。您可以在管道中添加 Google Play - Release Bundle 任务,并将 bundleFile
字段配置到生成的 .aab bundleFile 的位置。见下文。
- task: ms-vsclient.google-play.google-play-release-bundle.GooglePlayReleaseBundle@3
displayName: 'Release functionParam.ps1 to internal'
inputs:
serviceConnection: googleServiceEndPoint
applicationId: applicationId
bundleFile: **/*.aab
查看下面的教程,为您的 Android 应用程序创建管道
Build, test, and deploy Android apps
更新:
您可以在 Azure 管道中使用 jarsigner
命令签署 aab 包。您可能需要使用 download secure file task to use your keystore_file if you upload it to secure file。例如 运行 在 powershell 任务中的 jarsigner 命令下面:
jarsigner -verbose -sigalg SHA256withRSA -digestalg SHA-256 -keystore my_keystor_file.keystore -storepass 'super_secret_keystore_pass' -keypass 'super_secret_alias_password' my-app-bundle.aab myKeyStoreAlias
有关详细信息,请参阅
您还可以使用 Xamarin.Android 构建任务。并在 Additional arguments for the build 中传递以下参数以打包和签署 App Bundle:
-restore -t:SignAndroidPackage -p:AndroidPackageFormat=aab -p:AndroidKeyStore=True -p:AndroidSigningKeyStore=$(keystore.secureFilePath) -p:AndroidSigningStorePass=$(KeystorePassword) -p:AndroidSigningKeyAlias=$(KeystoreAlias) -p:AndroidSigningKeyPass=$(KeystorePassword)
有关详细信息,请参阅 here。
将 apkFiles 更改为 **/*.aab
并传递算法,-sigalg SHA256withRSA -digestalg SHA-256
作为 jarsignerArguments。
像这样:
- task: AndroidSigning@2
inputs:
apkFiles: '**/*.aab'
jarsign: true
jarsignerKeystoreFile: 'pathToYourKeystoreFile'
jarsignerKeystorePassword: '$(jarsignerKeystorePassword)'
jarsignerKeystoreAlias: '$(yourKeystoreAlias)'
jarsignerKeyPassword: '$(jarsignerKeyPassword)'
jarsignerArguments: '-sigalg SHA256withRSA -digestalg SHA-256'
zipalign: true