The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

Google Play Android Publisher Plugin

androidApkUpload: Upload Android APK to Google Play

  • apkFilesPattern (optional)
    Specifies filenames or patterns matching one or more APKs that should be uploaded to Google Play.

    You can use wildcards like "**/build/outputs/*/*-release.apk".
    See the 'includes' attribute of Ant's FileSet for the exact format.
    Note that multiple entries must be comma-separated.

    The base directory is the build's workspace. You can only upload APKs that are located in your workspace.

    Applications which have several APKs per release, taking advantage of Multiple APK Support, must have all of their APKs uploaded together, and all APKs must have the same application identifier (APK package name).
    This field supports substituting environment variables in the form ${SOME_VARIABLE} or $SOME_VARIABLE at build time.
    • Type: String
  • deobfuscationFilesPattern (optional)
    Specifies filenames or patterns matching one or more ProGuard mapping files that should be uploaded to Google Play, so that it can automatically deobfuscate stacktraces from crash reports.

    You can use wildcards like "**/build/**/mapping.txt".
    See the 'includes' attribute of Ant's FileSet for the exact format.
    Note that multiple entries must be comma-separated.

    The base directory is the build's workspace. You can only upload mapping files that are located in your workspace.

    If there are multiple APKs being uploaded, and only one mapping.txt file is found, then this file will be associated with each of the APKs being uploaded. If there are multiple mapping.txt files, this plugin will make a basic attempt to associate each mapping file with the corresponding APK.
    Otherwise, if the number of mapping files found is not equal to the number of APKs being uploaded, the build will fail, as this situation is not supported.

    For more information on deobfuscating crash stacktraces, see the Google Play documentation:
    https://support.google.com/googleplay/android-developer/answer/6295281 This field supports substituting environment variables in the form ${SOME_VARIABLE} or $SOME_VARIABLE at build time.
    • Type: String
  • expansionFilesPattern (optional)
    Specifies filenames or patterns matching zero or more expansion files that should be associated with the APK files being uploaded to Google Play.

    You can list as many or as few expansion files as you like — you have the option of associating previously-uploaded expansion files with the new APKs being uploading here.

    Naming

    Files must be named in the format [main|patch].<expansion-version>.<application-id>.obb

    For example:
    • main.1000.com.example.mygame.obb
    • patch.1002.com.example.mygame.obb

    Patterns

    You can use wildcards like "**/build/**/*.obb".
    See the 'includes' attribute of Ant's FileSet for the exact format.
    Note that multiple entries must be comma-separated.

    The base directory is the build's workspace. You can only upload OBB files that are located in your workspace.

    Re-using existing expansion files

    If you don't provide a main or patch expansion file for every APK that you want to upload, enabling the "Re-use expansion files from existing APKs where necessary" option will automatically associate existing expansion file(s) with the APK(s) being uploaded.

    With this option enabled, if not enough expansion files are provided for all of the APK(s) being uploaded, this plugin will search for the newest, previously-uploaded APKs on Google Play with main or patch expansion files, and will associate those files with the new APK(s) being uploaded here.

    For example: If you want to upload a new APK, but the expansion files have not changed at all, you should leave the "Expansion files" field blank, but enable the checkbox.
    At build time, the latest existing main (and patch, if available) expansion files will be associated with the newly-uploaded APK.

    Similarly, if you have a new build, but only want to change the patch file, then just provide the patch expansion file and make sure this option is checked. The uploaded APK will have the existing main expansion file associated with it, along with the newly-uploaded patch file. This field supports substituting environment variables in the form ${SOME_VARIABLE} or $SOME_VARIABLE at build time.
    • Type: String
  • googleCredentialsId (optional)
    Specifies which credential to use in order to connect to Google Play.

    The selected credential must be a "Google Service Account from private key" — if you have not added one already, refer to the documentation on this plugin's page.

    By choosing the "Parameter expression" option, you can also provide a credential at build time, either from an environment variable, or from a build parameter, e.g. the Credentials Parameter type.
    But you can use any type of expression, so long as it expands to the name of a "Google Service Account from private key" credential at build time. This field supports substituting environment variables in the form ${SOME_VARIABLE} at build time.
    Note that variables in the form $SOME_VARIABLE are not accepted by the Credentials Plugin.
    • Type: String
  • recentChangeList (optional)
    You can optionally apply "What's new" text to the uploaded APK(s), in order to inform your user of changes contained in the new app version.

    You add entries for as many or as few of your supported language as you wish, but each language must already have been added to your app, under the "Store Listing" section in the Google Play Developer Console.

    The language must match the language code shown in the Developer Console, e.g. "en-GB" for British English, or "ar" for Arabic.

    The text may be between zero and 500 characters.

    For more information on describing what's new in your app, see the Google Play documentation:
    https://support.google.com/googleplay/android-developer/answer/189724 Both fields support substituting environment variables in the form ${SOME_VARIABLE} or $SOME_VARIABLE at build time.
      Array/List
      Nested Object
    • language
      • Type: String
    • text
      • Type: String
  • rolloutPercentage (optional)
    The percentage of existing production users to which the uploaded APK(s) should be rolled out.

    Google Play limits the percentage values to:
    • 0.5%
    • 1%
    • 5%
    • 10%
    • 20%
    • 50%
    If you enter no value here, or 100%, the app will be rolled out to all users.

    This field is ignored if you choose a release track other than 'production'; releases to other tracks are always rolled out to 100% of the existing users.

    For more information on staged rollouts, see the Google Play documentation:
    https://support.google.com/googleplay/android-developer/answer/3131213 This field supports substituting environment variables in the form ${SOME_VARIABLE} or $SOME_VARIABLE at build time.
    • Type: String
  • trackName (optional)
    The release track to which the given APK file(s) will be assigned.

    This can be one of:
    • alpha
    • beta
    • production
    For production releases, you have the choice of rolling your new version out to all existing users simultaneously, or doing a staged rollout so that only a fraction of your existing userbase will be able to download the new version.

    For more information on alpha and beta testing, or staged rollouts, see the Google Play documentation:
    https://support.google.com/googleplay/android-developer/answer/3131213 This field supports substituting environment variables in the form ${SOME_VARIABLE} or $SOME_VARIABLE at build time.
    • Type: String
  • usePreviousExpansionFilesIfMissing (optional)
    • Type: boolean

androidApkMove: Move Android APKs to a different release track

If you have already uploaded APKs to Google Play, whether manually, via the "Upload Android APK to Google Play" post-build action, or by other means, this build step allows you to change the release track for specific APKs.

For example, you can use this to promote an app currently in alpha testing to the beta release track, once you've decided it's ready for a wider audience.

Similarly, once you're ready for release, you can move from beta to a staged rollout, or directly to production.

Note that "downgrading" release tracks, e.g. from production to alpha is not possible.
  • apkFilesPattern (optional)
    Specifies filenames or patterns matching one or more APK files from which the version codes should be read, in order to determine which APK versions should be re-assigned to a new release track.

    Note that these APKs should have already been uploaded — this build step will not do any uploading of APKs; it will only move existing APKs from one release track to another. To upload APKs, use the "Upload Android APK to Google Play" post-build action.

    You can use wildcards like "**/build/outputs/*/*-release.apk".
    See the 'includes' attribute of Ant's FileSet for the exact format.
    Note that multiple entries must be comma-separated.

    The base directory is the build's workspace. You can only reference APKs that are located in your workspace.

    Applications which have several APKs per release, taking advantage of Multiple APK Support, should list all of the APK files here.
    This field supports substituting environment variables in the form ${SOME_VARIABLE} or $SOME_VARIABLE at build time.
    • Type: String
  • applicationId (optional)
    Application ID (i.e. APK package name) of the app being assigned to a new release track. This field supports substituting environment variables in the form ${SOME_VARIABLE} or $SOME_VARIABLE at build time.
    • Type: String
  • fromVersionCode (optional)
    • Type: boolean
  • googleCredentialsId (optional)
    Specifies which credential to use in order to connect to Google Play.

    The selected credential must be a "Google Service Account from private key" — if you have not added one already, refer to the documentation on this plugin's page.

    By choosing the "Parameter expression" option, you can also provide a credential at build time, either from an environment variable, or from a build parameter, e.g. the Credentials Parameter type.
    But you can use any type of expression, so long as it expands to the name of a "Google Service Account from private key" credential at build time. This field supports substituting environment variables in the form ${SOME_VARIABLE} at build time.
    Note that variables in the form $SOME_VARIABLE are not accepted by the Credentials Plugin.
    • Type: String
  • rolloutPercentage (optional)
    The percentage of existing production users to which the given version code(s) should be rolled out.

    Google Play limits the percentage values to:
    • 0.5%
    • 1%
    • 5%
    • 10%
    • 20%
    • 50%
    If you enter no value here, or 100%, the app will be rolled out to all users.

    This field is ignored if you choose a release track other than 'production'; releases to other tracks are always rolled out to 100% of the existing users.

    For more information on staged rollouts, see the Google Play documentation:
    https://support.google.com/googleplay/android-developer/answer/3131213 This field supports substituting environment variables in the form ${SOME_VARIABLE} or $SOME_VARIABLE at build time.
    • Type: String
  • trackName (optional)
    The release track to which the given APK version(s) will be re-assigned.

    This can be one of:
    • alpha
    • beta
    • production
    For production releases, you have the choice of rolling the version(s) out to all existing users simultaneously, or doing a staged rollout so that only a fraction of your existing userbase will be able to download the new version.

    For more information on alpha and beta testing, or staged rollouts, see the Google Play documentation:
    https://support.google.com/googleplay/android-developer/answer/3131213 This field supports substituting environment variables in the form ${SOME_VARIABLE} or $SOME_VARIABLE at build time.
    • Type: String
  • versionCodes (optional)
    This specifies which APK versions should be assigned to a new release track.
    Note that multiple entries must be comma-separated.

    Applications which have several APKs in production, taking advantage of Multiple APK Support, should list the version codes of all APKs here.
    This field supports substituting environment variables in the form ${SOME_VARIABLE} or $SOME_VARIABLE at build time.
    • Type: String

Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.