本文翻译自:How to get the SHA-1 fingerprint certificate in Android Studio for debug mode?

I have shifted myself from Eclipse to Android Studio . 我已将自己从Eclipse转移到Android Studio 。 Now I am trying to work on my Map app. 现在我正在尝试使用我的地图应用程序。 So I need my SHA-1 fingerprint certificate number. 所以我需要我的SHA-1指纹证书号码。

When I was using Eclipse it was right under Windows -> Preferences -> Android -> Build . 当我使用Eclipse时,它正好在Windows - > Preferences - > Android - > Build下 。 But in Android Studio I couldn't find out any option like this so that I could find easily the fingerprint. 但是在Android Studio中,我找不到这样的选项,以便我可以轻松找到指纹。 I am using Windows. 我正在使用Windows。 I have read from this link that: 我从这个链接中读到:

Android Studio signs your app in debug mode automatically when you run or debug your project from the IDE. 当您从IDE运行或调试项目时,Android Studio会自动在调试模式下签署您的应用程序。

So I tried to run this in command line after setting my Java bin path from this link and unfortunately couldn't find my fingerprint. 所以我尝试在从此链接设置我的Java bin路径后在命令行中运行它,但遗憾的是找不到我的指纹。 It is saying that it is an illegal option . 据说这是非法的选择

keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

Is there a way to find the SHA-1 fingerprint from Android Studio like it was very easy in Eclipse? 有没有办法从Android Studio中找到SHA-1指纹,就像在Eclipse中一样容易? As I am newbie in Android Studio, what is the full process to find it? 由于我是Android Studio中的新手,找到它的完整过程是什么?

Another thing I want to add is that I have my Eclipse generates the SHA-1 fingerprint and previously I have my app registered on that fingerprint in Google developer console, and I worked on that app in Eclipse by that API key. 我想要添加的另一件事是我的Eclipse生成了SHA-1指纹,之前我在Google开发人员控制台中将该应用程序注册在该指纹上,并且我通过该API密钥在Eclipse中使用该应用程序。 Is the same API key can be worked on this my project in Android Studio? 在Android Studio中我的项目是否可以使用相同的API密钥?


#1楼

参考:https://stackoom.com/question/1rqTa/如何在Android-Studio中获取SHA-指纹证书以获得调试模式


#2楼

  • Go to File > Project Structure Select app or mobile whatever you gave the name from Modules 转到文件>项目结构选择appmobile无论您从Modules提供名称

  • Choose Signing tab. 选择Signing选项卡。

  • You can add certificate clicking on the + button. 您可以在+按钮上添加证书。


#3楼

My problem is the same as I have also shifted my Google Maps project from Eclipse to Android Studio . 我的问题与我将谷歌地图项目从Eclipse转移到Android Studio一样I have solved my problem by following this: 我通过以下方式解决了我的问题:

Go to your Java bin directory via the command: 通过以下命令转到Java bin目录:

C:\Program Files\Java\jdk1.7.0_71\bin>

Now type in the below command in your command window (CMD.EXE): 现在在命令窗口(CMD.EXE)中键入以下命令:

keytool -list -v -keystore c:\users\your_user_name\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android

Example: 例:

keytool -list -v -keystore c:\users\James\.android\debug.keystore -alias androiddebugkey -storepass android -keypass android

Or you can just write this in cmd if you don't know the username: 或者如果你不知道用户名,你可以在cmd中写这个:

keytool -list -v -keystore "%USERPROFILE%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android

And you will get the SHA1. 你会得到SHA1。

Then I created a new key from https://code.google.com/apis/console because of my package name got changed and then use this key in my application. 然后我从https://code.google.com/apis/console创建了一个新密钥,因为我的软件包名称已更改,然后在我的应用程序中使用此密钥。 It works fine. 它工作正常。

Make sure you are in BIN folder of jdkX.X.X_XX (my folder name is jdk1.7.0_71) , or else if you don't know what folder name you have then find it by opening the Java folder, and you will see what the folder name is, but you must be in your BIN folder and then run this command. 确保你在jdkX.X.X_XX的 BIN文件夹中(我的文件夹名称是jdk1.7.0_71) ,否则如果你不知道你有什么文件夹名称,那么打开Java文件夹找到它,你会看到文件夹名称是什么,但您必须在BIN文件夹中,然后运行此命令。 Today I have got my SHA1 value in a cmd command window by the above procedure. 今天我通过上面的过程在cmd命令窗口中得到了我的SHA1值。

SNAPSHOT: 快照:


#4楼

I want to add one thing with the answer given by Softcoder . 我想在Softcoder给出的答案中添加一个东西。 I have seen some people couldn't give their debug.keystore path correctly on the command line . 我看到有些人无法在command line上正确地给出他们的debug.keystore路径。 They see that they are doing the exact process accepted above, but it is not working. 他们看到他们正在做上面接受的确切过程,但它不起作用。 At that point try to drag the debug.keystore and drop it on the command line. 此时尝试拖动debug.keystore并将其放在命令行上。 It will help if the accepted answer is not working for you. 如果接受的答案不适合您,这将有所帮助。 Do the full process without any hesitation. 毫不犹豫地完成整个过程。 It was a nice answer. 这是一个很好的答案。


#5楼

对于Mac,这非常有效:

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

#6楼

I just found the case to get SHA-1 in Android Studio: 我刚刚找到了在Android Studio中获取SHA-1的案例:

  1. Click on your package and choose New -> Google -> Google Maps Activity 点击您的包,然后选择新建 - > Google - > Google地图活动
  2. Android Studio redirects you to google_maps_api.xml Android Studio会将您重定向到google_maps_api.xml

And you will see all you need to get google_maps_key . 您将看到获取google_maps_key所需的google_maps_key

如何在Android Studio中获取SHA-1指纹证书以获得调试模式?相关推荐

  1. android getter不起作用,java - 如何在Android Studio中自动生成getter和setter

    java - 如何在Android Studio中自动生成getter和setter Android Studio中是否有一个快捷方式可以自动生成给定类中的getter和setter? 14个解决方案 ...

  2. Android多个imei如何获取,如何在Android 10中获取IMEI号,这是获取在Android 10及以下Android 10中获取IMEI号的代码...

    如何在android 10中获取imei编号,这是获取在android 10及以下android 10中获取imei编号的代码. if (android.os.Build.VERSION.SDK_IN ...

  3. android studio点击图片,如何在Android Studio中的模拟器图库中添加图像?

    如何在Android Studio中的模拟器图库中添加图像? 我正在开发图像过滤器应用程序. 但是,如果我没有任何图像,就无法真正尝试. 我知道我可以在电话中对其进行测试,但这并不相同,因为我需要错误 ...

  4. 在java中添加源_关于Java:如何在Android Studio中添加链接的源文件夹?

    在Eclipse中,我可以将源文件夹作为"链接的源文件夹"添加到我的android项目中. 如何在Android Studio中实现同一目的? 或者是否可以添加外部文件夹以构建gr ...

  5. android编辑配置文件,如何在android studio中修改配置文件

    在使用android studio过程中,你知道怎么手动修改配置文件吗?下面是学习啦小编给大家整理的一些有关在android studio中修改配置文件的方法,希望对大家有帮助! 在android s ...

  6. android 最新sdk版本,详解如何在Android studio中更新sdk版本和build-tools版本

    一.首先看下Android开发用到的sdk目录: build-tools 保存着一些Android平台相关通用工具,比如adb.和aapt.aidl.dx等文件. aapt即Android Asset ...

  7. 如何在Android Studio中删除模块

    本文翻译自:How to delete a module in Android Studio Is there a way to delete a module within Android Stud ...

  8. android studio创建md,如何在Android Studio中设置*md文件打开方式

    最近在Android Studio中写一些Demo的时候,会顺便在里面创建一个.md文件用来进行Demo笔记的书写.然而Android Studio不带有markdown预览功能,所以我就琢磨如何在A ...

  9. linux gradle仓库位置,如何在Android Studio中使用Gradle发布项目至Jcenter仓库

    简述 目前非常流行将开源库上传至Jcenter仓库中,使用起来非常方便且易于维护,特别是在Android Studio环境中,只需几步配置就可以轻松实现上传和发布. Library的转换和引用 博主的 ...

最新文章

  1. 【 C 】const 进一步解读(由switch引出)
  2. 技术除了工作,还有什么可以提升的?
  3. 【学亮IT手记】PL/SQL编程-存储过程
  4. HihoCoder - 1873 Frog and Portal(构造+进制拆分)
  5. MySQL并发复制系列二:多线程复制
  6. 学校如何搭建文件服务器,学校服务器搭建
  7. 想做开源软件开发谁能带一下呀
  8. 程序员和编码员之间的区别
  9. Datamill 一个开源的框架
  10. 【渝粤教育】国家开放大学2018年秋季 2208T政治学原理 参考试题
  11. Conficker蠕虫病毒只是愚人节玩笑吗
  12. 复选框的对勾颜色怎么改
  13. 2021年全球自动浓缩咖啡机行业调研及趋势分析报告
  14. Utgard连接OPC Server常见故障码及解决方案
  15. 重装 Mac 系统后的安装软件和个人配置[个人习惯]
  16. docker打jdk 1.8镜像
  17. Empire信息收集
  18. 教务系统—课程表接口信息
  19. 稀疏数组真心话大冒险
  20. SQLI-LABS Page 1 ——Less 04

热门文章

  1. POI技术—用于java开发解析excel的抽象类
  2. Python入门(六) list
  3. MapReduce 支持的部分数据挖掘算法
  4. 程序自动化需要一个Windows服务
  5. 经典SQL语句大全(1)
  6. 关于数据库的一些基本操作语句
  7. Redis遍历所有key的两个命令 -- KEYS 和 SCAN
  8. 应用keyup监测输入框兼容IE处理
  9. Android:读取assets目录下文件(二)
  10. 使用 logback + slf4j 进行日志记录