DEBUG&的SHA1键发布ANDROID STUDIO MAC

时间:2016-01-21 20:11:16

标签: android google-api sha1

如何在mac上使用android studio调试和发布我的SHA1密钥? (这些是Google API密钥所必需的)

6 个答案:

答案 0 :(得分:116)

DEBUG:

  1. 单击视图右侧的Gradle选项卡。

  2. 转到ROOT文件夹 - >任务 - > android - > signingReport

  3. 双击,这将使用signingReport构建,并在底部视图中发布您的SHA1。

  4. RELEASE:

    1. 在android studio中。构建 - >生成签名APK ...并单击下一步

    2. 复制密钥库路径和密钥别名。

    3. enter image description here

      1. 遍历Java中存在的jdk路径的“bin”文件夹。

      2. 打开终端并输入:

        keytool -list -v -keystore“密钥库路径”-alias“密钥别名”

      3. 输入您的密钥密码,这将打印出您的版本SHA1。

答案 1 :(得分:6)

以下是查找发布 SHA-1或其他证书的最简单新方法:

我假设您已经构建了已签名的APK并将其上传到开发者控制台。 打开谷歌播放控制台。转到“版本管理”,转到“应用程序签名”并查看您的证书。

注意:首先谷歌会要求您为您的应用程序激活“应用程序签名”。

enter image description here

答案 2 :(得分:4)

要获得 DEBUG 的SHA1以及 RELEASE ,您必须在gradle文件的signingConfigs中添加关键详细信息,

see the example here

答案 3 :(得分:2)

希望通过 Android Studio 生成 release-apk SHA-1、SHA-256 和 MD5 的用户,请按照以下步骤操作:

  1. 转到项目结构 -> 默认配置 -> 签名配置,然后使用 Generate-Signed-Apk 期间提供的详细信息添加“RELEASE SHA1”。例如,

enter image description here

  1. 现在将您的签名配置设置为 $signingConfigs.'RELEASE SHA1'

enter image description here

  1. 最后,将您的构建变体更改为发布模式,并运行签名报告以在发布模式下生成密钥。

enter image description here

希望,这肯定会以最简单的方式生成 release-apk KEYS。

答案 4 :(得分:1)

根据新的Google Play控制台用户界面,该选项位于设置 >> 应用签名 enter image description here

答案 5 :(得分:1)

步骤1)在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'
}

第2步)从右侧菜单栏中打开gradle菜单,然后打开应用程序> android > signingReport

enter image description here

步骤3)点击signingReport并查看魔术

enter image description here