Android signing task

Azure Pipelines | Azure DevOps Server 2020 | Azure DevOps Server 2019 | TFS 2018 - TFS 2015

Use this task in a pipeline to sign and align Android APK files.

Demands

The build agent must have the following capabilities:

  • Java JDK

YAML snippet

# Android signing
# Sign and align Android APK files
- task: AndroidSigning@3
  inputs:
    #apkFiles: '**/*.apk' 
    #apksign: true # Optional
    #apksignerKeystoreFile: # Required when apksign == True
    #apksignerKeystorePassword: # Optional
    #apksignerKeystoreAlias: # Optional
    #apksignerKeyPassword: # Optional
    #apksignerArguments: '--verbose' # Optional
    #apksignerFile: # Optional
    #zipalign: true # Optional
    #zipalignFile: # Optional

Arguments

Argument Description
files
APK files

(Required) Relative path from the repo root to the APK(s) you want to sign. You can use wildcards to specify multiple files. For example:

  • outputs\apk*.apk to sign all .APK files in the outputs\apk\ subfolder
  • *\bin\.apk to sign all .APK files in all bin subfolders

Default value: **/*.apk
Argument aliases: apkFiles
Signing Options
apksign
Sign the APK
(Optional) Select this option to sign the APK with a provided Android Keystore file. Unsigned APKs can only run in an emulator. APKs must be signed to run on a device.
Default value: true
keystoreFile
Keystore file
(Required) Select or enter the file name of the Android Keystore file that should be used to sign the APK. This file must be uploaded to the secure files library where it is securely stored with encryption. The Android Keystore file will be used to sign the APK, but will be removed from the agent machine when the pipeline completes.
Argument aliases: apksignerKeystoreFile
keystorePass
Keystore password

(Optional) Enter the password for the provided Android Keystore file.

Important: Use a new variable with its lock enabled on the Variables pane to encrypt this value. See secret variables.

Argument aliases: apksignerKeystorePassword
keystoreAlias
Alias
(Optional) Enter the alias that identifies the public/private key pair to be used in the keystore file.
Argument aliases: apksignerKeystoreAlias
keyPass
Key password
(Optional) Enter the key password for the alias and Android Keystore file.
Important: Use a new variable with its lock enabled on the Variables pane to encrypt this value. See secret variables.

Argument aliases: apksignerKeyPassword
apksignerArguments
apksigner arguments

(Optional) Provide any options to pass to the apksigner command line. Default is: --verbose.

See the apksigner documentation.


Default value: --verbose
apksignerLocation
apksigner location

(Optional) Optionally specify the location of the apksigner executable used during signing. This defaults to the apksigner found in the Android SDK version folder that your application builds against.


Argument aliases: apksignerFile
Zipalign Options
zipalign
Zipalign

(Optional) Select if you want to zipalign your package. This reduces the amount of RAM consumed by an app.


Default value: true
zipalignLocation
Zipalign location

(Optional) Optionally specify the location of the zipalign executable used during signing. This defaults to the zipalign found in the Android SDK version folder that your application builds against.


Argument aliases: zipalignFile
Control options

Android Build