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

AndroidMacosGoogle ApiReleaseSha1

Android Problem Overview


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

Android Solutions


Solution 1 - Android

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 - Android

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 - Android

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 - Android

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 - Android

> 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

Solution 6 - Android

As per new Google Play Console UI, the option is available at Setup >> App Integrity enter image description here

Solution 7 - Android

For those who wants to generate release-apk SHA-1, SHA-256 and MD5 through Android Studio, follow these steps:

  1. Goto Project Structure -> Default Config -> Signing Config and then add "RELEASE SHA1" using details provided during Generate-Signed-Apk. For e.g.,

enter image description here

  1. Now set your Signing Config to $signingConfigs.'RELEASE SHA1'

enter image description here

  1. Finally, change your build variant to release mode and run signingReport to generate Keys in release mode.

enter image description here

Hope that, this would definitely generate the release-apk KEYS in easiest way.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionandyc101View Question on Stackoverflow
Solution 1 - Androidandyc101View Answer on Stackoverflow
Solution 2 - AndroidErenView Answer on Stackoverflow
Solution 3 - AndroidJayakrishnanView Answer on Stackoverflow
Solution 4 - AndroidSurender KumarView Answer on Stackoverflow
Solution 5 - AndroidQuick learnerView Answer on Stackoverflow
Solution 6 - AndroidFaizan Haidar KhanView Answer on Stackoverflow
Solution 7 - AndroidMohd AsimView Answer on Stackoverflow