androidazure-devopsazure-pipelinesazure-devops-pipelines

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.


Solution

  • 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.