Build: Android signing

Last Update: 3/13/2017

Team Services | TFS 2017 | TFS 2015 | Previous versions (XAML builds)

Sign and align Android APK files

Demands

The build agent must have the following capabilities:

  • Java JDK

Arguments

Argument Description
APK Files

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
Signing Options
Sign the APK Select this option to sign the APK with a provided keystore file. Unsigned APKs can only run in an emulator. APKs must be signed to run on a device.
Keystore File Enter the file path to the keystore file that should be used to sign the APK. It can either be checked into source control or placed on the build machine directly by an administrator. It is recommended to encrypt the keystore file in source control and use the Decrypt File task to decrypt the file during the build.
Keystore Password

Enter the password for the provided keystore file.

Important: We recommend that you put this value in a secret variable.
Alias Enter the alias that identifies the public/private key pair to be used in the keystore file.
Key Password Enter the key password for the alias and keystore file.
Important: We recommend that you put this value in a secret variable.
Jarsigner Arguments

Provide any options to pass to the jarsigner command line. Default is -verbose -sigalg MD5withRSA -digestalg SHA1

See jarsigner documentation.

Zipalign Options
Zipalign

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

Zipalign Location

(Optional) The location of the zipalign executable used during signing. Defaults to the zipalign found in the Android SDK version folder your application builds against.

Control options

Android Build