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 codemagic

Keytool 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

  1. Open the settings page and go to codemagic.yaml settings > Code signing identities.

  2. Open the Android keystores tab.

  3. Upload the keystore file by clicking Choose a file or by dragging it into the indicated frame.

  4. Enter the Keystore password, Key alias, and Key password values as indicated.

  5. Enter a keystore Reference name. This is a unique name used to reference the file in codemagic.yaml.

  6. 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_name

Replace your_keystore_name with the reference name you provided when uploading the keystore.