There are two types of fingerprint certificates in Android, one is Debug and the other is Release. You need to sign your app in Debug mode just for testing purposes. Do not publish apps that are singed in debug mode. You need to sign your app with Release certificate before publishing. Here's how to get the SHA1 fingerprint certificate for both Release and Debug mode in Android.
|SHA1 fingerprint using command line windows|
1. Generating the release SHA1 fingerprint certificate
- Before generating the release certificate, you need to first generate signed apk. You can choose the generate signed apk option from build menu in Android Studio. You may choose an existing keystore or create a new one, remember the alias name, as you might need it later. Here's more information about generating signed apk. Generate signed APK
- Once you've generate the signed apk you can easily find out your SHA1 fingerprint using the keytool command -
- keytool -list -keystore keystore_path.jks. You need to run this command from the bin directory of your java installation folder. Usually it's located at C:\Program Files\Java\jdk1.8.0_11\bin.
- In the command above, you need to replace the keystore_name with the path of the keystore you had created in the first step.
- After you execute this command, you will be asked for you alias name, so remember the alias name that you created in the first step and input that alias name, and bingo you have for release SHA1 Fingerprint certificate.
2. Generating the debug SHA1 fingerprint certificate
To generate debug SHA1 fingerprint certificate, you first need to know the location of your debug.keystore file. This file is created by automatically by Android Studio when you first build your project. The location of this file for window user is C:\Users\YourUsername\.android\ and for mac and linux user is ~/.android/
- Once you have the path just execute the following -
- keytool -list -alias androiddebugkey -keystore C:\Users\YourUsername\.android\debug.keystore
- Once you execute it, the terminal will ask for a password, the password is android, It won't be visible when you type it.
- And now you have your debug SHA1 fingerprint certificate. Use it to test your application.