SHA1 Key for DEBUG & RELEASE ANDROID STUDIO MAC , How to generate SHA1 Release Keys in Mac?

81,724

Solution 1

DEBUG:

  1. Click on the Gradle tab on the right hand side of the view.

  2. Go to the ROOT folder -> Tasks -> android -> signingReport

  3. Double click, this will build with the signingReport and post in your bottom view your SHA1.

RELEASE:

  1. In android studio. Build -> Generate Signed APK... and click Next

  2. Copy your key store path and key alias.

enter image description here

  1. Traverse to the "bin" folder of the jdk path present in Java.

  2. Open terminal and enter:

    keytool -list -v -keystore "key store path" -alias "key alias"

  3. Enter your key password and this will print out your release SHA1.

Solution 2

UPDATE:

In the new Google Developer console, it can be found at Setup -> App Integrity.

enter image description here

OLD ANSWER:

Here is the new easiest way to find release SHA-1 or other certificates:

I assume that you have already built signed APK and uploaded it to developer console. Open google play console. Go to "Version Management", go to "Application Signing" and see your certificates.

Note: First google will ask you to activate "Application Signing" for your application.

enter image description here

Solution 3

The entire process of generating certificate fingerprints SHA-1, SHA-256, MD5 for DEBUG as well as RELEASE are divided into the following 3 steps,

  1. Create keystore properties
  2. Load keystore To Gradle
  3. Execute Gradle Task

For genertaing SHA-1 key for release build variant, you have to add signingConfigs for release in your main module's build.gradle file.

Detailed explanation given in this blog

Solution 4

For Debug Keystore

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

For release Keys

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

Solution 5

Step 1 ) Add release details in gradle

apply plugin: 'com.android.application'
android {
    compileSdkVersion 24
    buildToolsVersion "23.0.1"
    defaultConfig {
        applicationId "app.devdeeds.com.yourapplication"
        minSdkVersion 17
        targetSdkVersion 24
        versionCode 1
        versionName "1.0"
    }
//Signing configurations for build variants "release"
    signingConfigs {
        release {
            storeFile file("F:/Development/myapp.jks")
            storePassword "231232das"
            keyAlias "myapp_rel"
            keyPassword "dasd333_das"
        }
    }
    buildTypes {
    //link above defined configuration to "release" build type
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.release
        }
    }
}
dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:24.0.0'
}

Step 2) open gradle menu from right menu bar and then app > android > signingReport

enter image description here

Step 3) Click on signingReport and see the magic

enter image description here

Share:
81,724
Admin
Author by

Admin

Updated on July 09, 2022

Comments

  • Admin
    Admin almost 2 years

    How do I get my SHA1 Keys for debug and release using android studio on a mac? (These are required for Google API Keys)

  • Manish
    Manish over 7 years
    hey can u tell me how to generate release key using Linux terminal ..it gives me an error
  • Dharmbir Singh
    Dharmbir Singh over 7 years
    Kindly have a look on this video How to create SHA1 for release youtu.be/g75cZXjmuj8
  • Ashish Karpe
    Ashish Karpe about 6 years
    I am building Apk using Jenkins running on Ubuntu, which creates Signed APKs, so how to get this release SHA1 & build SHA1.
  • Tushar Lathiya
    Tushar Lathiya about 5 years
    time saver method +1. Thx a lot.
  • fahadayaz
    fahadayaz almost 5 years
    Thank you. This is what I needed to figure out what my SHA1 key was after it had been signed as an App Bundle. Firebase Auth needed the SHA1 fingerprint to have been registered and I couldn't find where to see it.
  • ArpitA
    ArpitA over 4 years
    @HimanshuTiwari As per google : This is the public certificate for the app signing key that Google Play uses to sign your app before distributing it to Android devices. The app signing key itself is inaccessible and kept on a secure Google server. Use the certificate below to register your app signing key with your API providers. This means that the app signing key available in the dashboard may change if google decides to re-sign it . But our own app signing will always remain the same . Did you consider this scenario ??
  • Hisham Mubarak
    Hisham Mubarak almost 4 years
    Thank you! After hours of searching, found your answer, and it fixed my issues. Thank again
  • Mark Ebden
    Mark Ebden almost 4 years
    I'm using Android Studio 4.0 (20 May 2020). Under Build, there is no 'Generate Signed APK'. Instead, it shows "Flutter, Make Module, Run Generate Sources Grade Tasks, Make Module (again), Analyze APK, Deploy Module to App Engine, Rebuild Project" plus some greyed out options. Searching 'Help' for keystore or 'key store' yields nothing useful. Has Android Studio changed in 2020?
  • prasadsunny1
    prasadsunny1 almost 4 years
    Open the android module using android studio and you will find the options mentioned in this answer. When we open flutter projects, these tasks are not available and it is correct behaviour. These tools only show up when there is an android based project opened in the IDE
  • Malay M
    Malay M over 3 years
    Life saviour <3
  • Enigmo96
    Enigmo96 about 3 years
    Use can you terminal inside Android Studio (or IntelliJ) instead of terminal
  • DIRTY DAVE
    DIRTY DAVE about 3 years
    Thank you for this answer, it made everything much easier.
  • Emam
    Emam over 2 years
    Thanks this really helped me a lot @Surender Kumar