簡體   English   中英

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 應用程序並將其作為 App Bundle 部署到 Google Play 商店或 App Center。

我可以想辦法部署一個 apk,但需要幫助來部署應用程序包 (.aab)。 任何幫助,將不勝感激。

您可以使用 Google Play - Release Bundle 任務來部署應用程序包 (.aab)。 在您的 azure devops 組織中安裝Google Play 擴展后。 您可以在管道中添加 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 應用程序創建管道

構建、測試和部署 Android 應用

更新:

您可以在 azure 管道中使用jarsigner命令對 aab 包進行簽名。 如果您將 keystore_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 構建任務。 並在構建的附加參數中傳遞以下參數以打包和簽署 App Bundle:

-restore -t:SignAndroidPackage -p:AndroidPackageFormat=aab -p:AndroidKeyStore=True -p:AndroidSigningKeyStore=$(keystore.secureFilePath) -p:AndroidSigningStorePass=$(KeystorePassword) -p:AndroidSigningKeyAlias=$(KeystoreAlias) -p:AndroidSigningKeyPass=$(KeystorePassword)

請參閱此處了解更多信息。

將 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

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM