Skip to content

Latest commit

 

History

History
312 lines (251 loc) · 13.4 KB

android-signing-v3.md

File metadata and controls

312 lines (251 loc) · 13.4 KB
title description ms.date monikerRange
AndroidSigning@3 - Android Signing v3 task
Sign and align Android APK files.
07/02/2024
>=azure-pipelines-2019

AndroidSigning@3 - Android Signing v3 task

:::moniker range=">=azure-pipelines-2019"

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

:::moniker-end

Syntax

:::moniker range=">=azure-pipelines-2020.1"

# Android Signing v3
# Sign and align Android APK files.
- task: AndroidSigning@3
  inputs:
    apkFiles: '**/*.apk' # string. Alias: files. Required. APK files. Default: **/*.apk.
  # Signing Options
    #apksign: true # boolean. Sign the APK. Default: true.
    apksignerKeystoreFile: # string. Alias: keystoreFile. Required when apksign = true. Keystore file. 
    #apksignerKeystorePassword: # string. Alias: keystorePass. Optional. Use when apksign = true. Keystore password. 
    #apksignerKeystoreAlias: # string. Alias: keystoreAlias. Optional. Use when apksign = true. Alias. 
    #apksignerKeyPassword: # string. Alias: keyPass. Optional. Use when apksign = true. Key password. 
    #apksignerVersion: 'latest' # string. Optional. Use when apksign = true. apksigner version. Default: latest.
    #apksignerArguments: '--verbose' # string. Optional. Use when apksign = true. apksigner arguments. Default: --verbose.
    #apksignerFile: # string. Alias: apksignerLocation. Optional. Use when apksign = true. apksigner location. 
  # Zipalign Options
    #zipalign: true # boolean. Zipalign. Default: true.
    #zipalignVersion: 'latest' # string. Optional. Use when zipalign = true. Zipalign version. Default: latest.
    #zipalignFile: # string. Alias: zipalignLocation. Optional. Use when zipalign = true. Zipalign location.

:::moniker-end

:::moniker range=">=azure-pipelines-2019 <=azure-pipelines-2020"

# Android Signing v3
# Sign and align Android APK files.
- task: AndroidSigning@3
  inputs:
    apkFiles: '**/*.apk' # string. Alias: files. Required. APK files. Default: **/*.apk.
  # Signing Options
    #apksign: true # boolean. Sign the APK. Default: true.
    apksignerKeystoreFile: # string. Alias: keystoreFile. Required when apksign = true. Keystore file. 
    #apksignerKeystorePassword: # string. Alias: keystorePass. Optional. Use when apksign = true. Keystore password. 
    #apksignerKeystoreAlias: # string. Alias: keystoreAlias. Optional. Use when apksign = true. Alias. 
    #apksignerKeyPassword: # string. Alias: keyPass. Optional. Use when apksign = true. Key password. 
    #apksignerArguments: '--verbose' # string. Optional. Use when apksign = true. apksigner arguments. Default: --verbose.
    #apksignerFile: # string. Alias: apksignerLocation. Optional. Use when apksign = true. apksigner location. 
  # Zipalign Options
    #zipalign: true # boolean. Zipalign. Default: true.
    #zipalignFile: # string. Alias: zipalignLocation. Optional. Use when zipalign = true. Zipalign location.

:::moniker-end

Inputs

:::moniker range=">=azure-pipelines-2019"

apkFiles - APK files
Input alias: files. string. Required. Default value: **/*.apk.

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

:::moniker-end

:::moniker range=">=azure-pipelines-2019"

apksign - Sign the APK
boolean. Default value: true.

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


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

apksignerKeystoreFile - Keystore file
Input alias: keystoreFile. string. Required when apksign = true.

The file path to the Android Keystore file that is 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 is removed from the agent machine when the pipeline completes.

The file 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.


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

apksignerKeystorePassword - Keystore password
Input alias: keystorePass. string. Optional. Use when apksign = true.

The key 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.


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

apksignerKeystoreAlias - Alias
Input alias: keystoreAlias. string. Optional. Use when apksign = true.

The alias that identifies the public/private key pair to be used in the Android Keystore file.


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

apksignerKeyPassword - Key password
Input alias: keyPass. string. Optional. Use when apksign = true.

The key password for the alias and keystore file.

Important

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


:::moniker-end

:::moniker range=">=azure-pipelines-2020.1"

apksignerVersion - apksigner version
string. Optional. Use when apksign = true. Default value: latest.

The Android SDK build-tools version that the apksigner executable uses for the task.


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

apksignerArguments - apksigner arguments
string. Optional. Use when apksign = true. Default value: --verbose.

Provides options to pass to the apksigner command line. See the apksigner documentation.


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

apksignerFile - apksigner location
Input alias: apksignerLocation. string. Optional. Use when apksign = true.

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


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

zipalign - Zipalign
boolean. Default value: true.

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


:::moniker-end

:::moniker range=">=azure-pipelines-2020.1"

zipalignVersion - Zipalign version
string. Optional. Use when zipalign = true. Default value: latest.

The Android SDK build-tools version that the zipalign executable uses for the task.


:::moniker-end

:::moniker range=">=azure-pipelines-2019"

zipalignFile - Zipalign location
Input alias: zipalignLocation. string. Optional. Use when zipalign = true.

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


:::moniker-end

Task control options

All tasks have control options in addition to their task inputs. For more information, see Control options and common task properties.

Output variables

:::moniker range=">=azure-pipelines-2019"

None.

:::moniker-end

Remarks

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

This version of the task uses apksigner instead of jarsigner to sign APKs.

Requirements

:::moniker range=">=azure-pipelines-2022"

Requirement Description
Pipeline types YAML, Classic build
Runs on Agent, DeploymentGroup
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: JDK
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions This task runs using the following command restrictions: restricted
Settable variables This task has permission to set the following variables: Setting variables is disabled
Agent version 2.182.1 or greater
Task category Build

:::moniker-end

:::moniker range=">=azure-pipelines-2019.1 <=azure-pipelines-2020.1"

Requirement Description
Pipeline types YAML, Classic build
Runs on Agent, DeploymentGroup
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: JDK
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 2.116.0 or greater
Task category Build

:::moniker-end

:::moniker range="=azure-pipelines-2019"

Requirement Description
Pipeline types YAML, Classic build
Runs on Agent, DeploymentGroup
Demands Self-hosted agents must have capabilities that match the following demands to run jobs that use this task: JDK, AndroidSDK
Capabilities This task does not satisfy any demands for subsequent tasks in the job.
Command restrictions Any
Settable variables Any
Agent version 2.116.0 or greater
Task category Build

:::moniker-end