Android Code Signing
此内容尚不支持你的语言。
To publish on the Play Store, you need to sign your app with a digital certificate.
Android App Bundles and APKs must be signed before being uploaded for distribution.
Google also provides an additional signing mechanism for Android App Bundles distributed in the Play Store. See the official Play App Signing documentation for more information.
Creating a keystore and upload key
Android signing requires a Java Keystore file that can be generated using the official keytool
CLI:
This command stores the upload-keystore.jks
file in your home directory.
If you want to store it elsewhere, change the argument you pass to the -keystore
parameter.
See the official documentation for more information.
Configure the signing key
Create a file named [project]/src-tauri/gen/android/keystore.properties
that contains a reference to your keystore:
You will usually generate this file in your CI/CD platform. The following snippet contains an example job step for GitHub Actions:
In this example the keystore was exported to base64 with base64 -i /path/to/keystore.jks
and set as the ANDROID_KEY_BASE64
secret.
Configure Gradle to use the signing key
Configure gradle to use your upload key when building your app in release mode by editing the [project]/src-tauri/gen/android/app/build.gradle.kts
file.
-
Add the needed import at the beginning of the file:
-
Add the
release
signing config before thebuildTypes
block: -
Use the new
release
signing config in therelease
config inbuildTypes
block:
Release builds of your app will now be signed automatically.
© 2024 Tauri Contributors. CC-BY / MIT