Complete Guide to Creating a Keystore for Android

What is a Keystore and Why is it Important?

The Keystore is a secure storage for the cryptographic keys necessary to sign your Android app. Signing your app is mandatory as it ensures the integrity and authenticity of the app. Without a Keystore, you cannot publish or update your app on Google Play.

A Keystore contains pairs of public and private keys. The private key is used to sign the app and must be kept secure. The public key is used to verify the app's signature.

Important Note: If you lose the Keystore or forget the password, you won’t be able to update your already-published app on Google Play. In such a case, you'll need to create a new app, losing all reviews, ratings, and installations of the previous version.

Keystore Structure

A Keystore contains the following components:

Warning: Never forget your passwords. Without them, you won’t be able to access or use the Keystore.

Preparation Before Creating a Keystore

Creating a Keystore on Mac and Windows

On Mac

Open the Terminal and navigate to the folder where you want to save the Keystore:

cd folder_path

Run the following command to generate the Keystore:

keytool -genkey -v -keystore my-release-key.keystore -alias key_alias -keyalg RSA -keysize 2048 -validity 10000

Fill in the requested information (name, organization, country). Make sure to note down all details, as they will be needed for app updates in the future.

On Windows

Open the Command Prompt and navigate to the folder where you want to save the Keystore:

cd folder_path

Run the same command as on Mac to generate the Keystore.

Keystore Security and Management

Publishing and Updating Your App on Google Play

Frequently Asked Questions and Additional Resources