Updated on 2024-10-31 GMT+08:00

Signing Android APK

Sign an APK with apksigner.

Build on GUI

  1. Add Sign Android APK after Build with Android, when configuring build actions.

    The parameters are described in the following table.

    Parameter

    Description

    Action Name

    Assign a custom name to the build action.

    APK Location

    Location of the APK file to be signed generated after Android building. Regular expressions are supported. For example, build/bin/*.apk can be used to match the built APK package.

    Keystore File

    Used for signing. You can create the file by referring to Generating Keystore Signature Files. Select one from those uploaded on the file management page.

    Keystore Password

    Keystore password.

    Alias

    Alias of the keystore file.

    Key Password

    Password of the key.

    apksigner CLI

    Custom signature parameter. By default, --verbose is added to display the signature details.

  2. Check whether the signing is successful.

    After the configuration is complete, run the build task. After the task is executed successfully, view the build log. If "Result: Signed" is displayed in the Android APK signature log, the signing is successful.

Build with Code

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
version: 2.0 # The value must be 2.0.
steps:
  BUILD:
    - android_sign:
            inputs:
               file_path: build/bin/*.apk
                   keystore_file: androidapk.jks
                   keystore_password: xxxxxx
                   alias: keyalias
                   key_password: xxxxxx
                   apksigner_commond: --verbose

Parameter

Type

Description

Mandatory

Default Value

file_path

String

Directory of the APK that needed to be signed

Yes

None

keystore_file

String

Keystore file name

Yes

None

keystore_password

String

Keystore file password

No

None

alias

String

Alias

Yes

None

key_password

String

Password

No

None

apksigner_commond

String

apksigner command

Yes

None