How to Get the SHA-1 Fingerprint of a Keystore Certificate

How to Get the SHA-1 Fingerprint of a Keystore Certificate

22 May 2024 Stephan Petzl Leave a comment Tech-Help

Understanding how to obtain the SHA-1 fingerprint of a keystore certificate is essential for various development tasks, such as integrating Google Maps or Firebase services into your Android application. This guide will provide you with clear steps to retrieve the SHA-1 fingerprint for both debug and release modes.

Method 1: Using Keytool Command

The keytool command is a versatile tool for managing keystore certificates. Follow these steps:

For Debug Mode:

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

For Release Mode:

keytool -list -v -keystore {keystore_name} -alias {alias_name}

Example:

keytool -list -v -keystore C:\Users\MG\Desktop\test.jks -alias test

Note: If the keytool command is not found, navigate to your JDK directory (e.g., C:\Program Files\Java\jdk1.8.0_231\bin\) and try the commands again.

Method 2: Using Gradle in Android Studio

Android Studio offers a convenient way to obtain the SHA-1 fingerprint through Gradle tasks. Follow these steps:

  1. Open Android Studio and your project.
  2. Click on the “Gradle” tab in the right-side panel.
  3. Expand the “Tasks” tree and navigate to android > signingReport.
  4. Double-click on signingReport to generate the SHA-1 fingerprint. The results will be displayed in the “Run” tab.

For Newer Versions of Android Studio:

If you are using Android Studio 2.2 or newer, the results will be available in the “Run” console. Use the toggle button to switch to task execution mode if needed.

Additional Tips for Obtaining SHA-1 Fingerprint

Here are some additional methods and tips for obtaining the SHA-1 fingerprint:

  • For Eclipse users, navigate to Window > Preferences > Android > Build to find the SHA-1 fingerprint.
  • For Linux users, use the following command:
    keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
  • If you are using Google Play App Signing, obtain the release SHA-1 from the “App Signing” page in your Google Play Console.

Automating Your Testing with Repeato

While obtaining the SHA-1 fingerprint is a crucial step, ensuring your app’s functionality through rigorous testing is equally important. This is where Repeato comes in. Repeato is a no-code test automation tool for iOS and Android that simplifies the process of creating, running, and maintaining automated tests.

With Repeato, you can quickly edit and run tests using computer vision and AI, allowing you to focus on developing a great product rather than spending time on test maintenance. Additionally, Repeato enables non-technical colleagues or QA teams to handle test automation, making it a versatile tool for any development team.

Learn more about how Repeato can streamline your testing process by visiting our Getting Started page.

Like this article? there’s more where that came from!