How do I generate and configure a keystore for Android code signing in Codemagic?
Last updated: August 14, 2026
Context
When building and publishing an Android app with Codemagic, you need a keystore file to sign your app. This article explains how to generate a keystore and configure it in Codemagic for use in your workflow.
Answer
Follow the steps below to generate a keystore, upload it to Codemagic, and reference it in your workflow.
Step 1: Generate the keystore
Run the following command on your local machine using the Java Keytool utility:
keytool -genkey -v -keystore codemagic.keystore -storetype JKS -keyalg RSA -keysize 2048 -validity 10000 -alias codemagicKeytool will prompt you to enter your personal details for creating the certificate, as well as passwords for the keystore and the key. It will then generate the keystore as a file called codemagic.keystore in your current directory.
Step 2: Upload the keystore to Codemagic
Open the settings page and go to codemagic.yaml settings > Code signing identities.
Open the Android keystores tab.
Upload the keystore file by clicking Choose a file or by dragging it into the indicated frame.
Enter the Keystore password, Key alias, and Key password values as indicated.
Enter a keystore Reference name. This is a unique name used to reference the file in
codemagic.yaml.Click the Add keystore button to save the keystore.
Step 3: Reference the keystore in your workflow
Add the name of your uploaded keystore under the android_signing field in your codemagic.yaml file:
workflows:
android-workflow:
name: Android Workflow
environment:
android_signing:
- your_keystore_nameReplace your_keystore_name with the reference name you provided when uploading the keystore.