Android Keystore Creation Guide

From D-Wiki

Android Keystore Creation Guide

A short guide on creating debug and release Android Keystores.

Release Keystores

You have two main possibilities when you want to create new Android Keystores. One is via the Java Keytool and the other is a GUI-based variant inside Android Studio.

Java Keytool

  • Open the following path {JAVA_JDK_PATH}/bin and open up the command line.
  • Enter the command keytool -genkey -keystore {KEYSTORE_NAME}.keystore -alias {ALIAS_NAME} -keyalg RSA -keysize 2048 -validity {VALIDITY_LENGTH ex. 10000}
  • Fill in the Information on the dialog inside the command prompt.

And you're done. :)

Android Studio

  • Click on > Build > Generate Signed Bundle / APK... > APK > Under the Keystore Path click the button Create New.
  • Fill out the form.

And you're done as well. :)

Debug Keystores

Debug Keystore creation is identical to the Release Keystore creation but only differs in the parameters used, since Debug Keystores use "predefined-values".

These are those values:

  • Keystore name: "debug.keystore"
  • Keystore password: "android"
  • Key alias: "androiddebugkey"
  • Key password: "android"
  • CN: "CN=Android Debug,O=Android,C=US"

Shorthand Keytool Command:

keytool -genkey -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug