Sign an APK
Find the apksigner module at/Android/sdk/build-tools/<version>/ and perform the following steps to sign an APK with APKSigner:
To sign an APK with Android APKSigner, run the following command:
Adjust the values for the following arguments to match your environment:
- —ks-pass: The password set for the keystore when you created it in the previous section,
- —ks-key-alias: The key alias you provided in the previous section, such as apksignerdemo.
- —in: The
.apkfile you want to sign, including the full path to the file if necessary. - —out: The name of the signed
.apkfile, including the full path if necessary.
Shell
To verify the signature of the output file, run the following command:
Shell
You should see output similar to the following example:
Shell
In the preceding example, multiple signatures occurred for different Android signing versions. To only sign with one signing version type, add the following flags to your command and enable only the version you want to use to sign:
Shell
APKSigner demonstration
The following command demonstrates a signing command with APKSigner:Shell
Shell

