Sign APKs with Android APKSigner by using Futurex PKCS #11
This section shows how to sign an APK with APKSigner and provides a demonstration.
Find the apksigner module at /Android/sdk/build-tools/<version>/ and perform the following steps:
To sign an APK with Android APKSgner, 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 .apk file you want to sign, including the full path to the file if necessary.
- --out: The name of the signed .apk file, including the full path if necessary.
To verify the signature of the output file, run the following command:
You should see output similar to the following example:
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:
The following example demonstrates a signing command with APKSigner:
The following example demonstrates a verification command with APKSigner:
For more information on APKSigner and its functions, refer to the Android Developer Documentation.