Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure devops pipeline to build and deploy my native Android application Google Play store or App Center as App Bundle

I need to setup Azure a devops pipeline to build and deploy my native Android application to Google Play store or App Center as App Bundle.

I could figure out to deploy an apk but need help to deploy app bundle(.aab). Any help would be appreciated.

like image 577
user_1989 Avatar asked Sep 09 '20 11:09

user_1989


2 Answers

Change the apkFiles to **/*.aab and pass the algorithms, -sigalg SHA256withRSA -digestalg SHA-256 as jarsignerArguments.

Like this:

- task: AndroidSigning@2
  inputs:
     apkFiles: '**/*.aab' 
     jarsign: true 
     jarsignerKeystoreFile: 'pathToYourKeystoreFile'
     jarsignerKeystorePassword: '$(jarsignerKeystorePassword)'
     jarsignerKeystoreAlias: '$(yourKeystoreAlias)'
     jarsignerKeyPassword: '$(jarsignerKeyPassword)'
     jarsignerArguments: '-sigalg SHA256withRSA -digestalg SHA-256'
     zipalign: true
like image 186
Peter Avatar answered Sep 23 '22 15:09

Peter


You can use the Google Play - Release Bundle task to deploy app bundle(.aab). After the Google play extension is installed in your azure devops organization. You can add Google Play - Release Bundle task in your pipeline and configure the bundleFile field to the location of the generated .aab bundleFile. See below.

- task: ms-vsclient.google-play.google-play-release-bundle.GooglePlayReleaseBundle@3
  displayName: 'Release functionParam.ps1 to internal'
  inputs:
    serviceConnection: googleServiceEndPoint
    applicationId: applicationId
    bundleFile: **/*.aab 
    

Check out below tutorial to create a pipeline for your Android application

Build, test, and deploy Android apps

Update:

You can sign aab bundle using jarsigner command in azure pipeline. You might need to use download secure file task to use your keystore_file if you upload it to secure file. For example run below jarsigner command in a powershell task:

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

See this thread for more information.

You can also use Xamarin.Android build task. And pass below arguements in Additional arguments for the build to package and sign the App Bundle:

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

See here for more information.

like image 38
Levi Lu-MSFT Avatar answered Sep 22 '22 15:09

Levi Lu-MSFT