在Mac上为Android应用签名Android应用 [英] Signing Android app on Mac for Facebook App

查看:215
本文介绍了在Mac上为Android应用签名Android应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



现在,我已经切换到Mac,而且,我必须再次签署我的应用程序。



我按照Mac解释的步骤在mac上找不到keytool



我已经设法生成签名的.APK,但我做不明白在Mac上找到我的应用程序的Android Key Hash吗?



任何人都可以指向正确的方向。

解决方案

我不是Mac用户,所以不能给你一个专门针对Mac的解决方案,但是我可以给你一些更好和更简单的东西。



我在这里发布了类似的答案: https://stackoverflow.com/a/13283088/ 450534个。无论平台如何,第二种解决方案都可以工作。



请试试。这是与上面提到的答案完全相同的。



我总是发现最简单的事情就是让Facebook SDK告诉你你的哈希密钥是什么。这是更简单,不应该花费几分钟。



步骤1:
在你的Facebook SDK,找到 Util.java 类。在此,请更改:

  private static boolean ENABLE_LOG = false; 

to:

 code> private static boolean ENABLE_LOG = true; 

步骤2:
创建一个 / strong>签名的APK,转移到您的设备并安装。如果已经安装了,那么它会自动提示。



步骤3:
随着你的DDMS(Logcat)运行,你的设备连接到计算机,运行应用程序,并继续寻找密钥错误警告。该警告具有实际哈希键。复制该密钥,转到您的Facebook开发人员页面,并将新密钥添加到列表中。



您也可以从我的答案中查看评论。 https://stackoverflow.com/a/10516629/450534 。在第三个评论中,OP已经在 Logcat 中发布了回复。



编辑:官方Facebook 入门 - 第4步页面提供此命令在Mac上生成密钥哈希:


keytool -exportcert -alias androiddebugkey -keystore
〜/ .android / debug.keystore | openssl sha1 -binary | openssl base64



I used to sign my apps on PC with keytool, and get the hashcode that is used in FB app.

Now, I've switched to Mac, and I have to sign my app again.

I've followed the procedure explained for mac cannot find keytool on a mac

I've managed to generate signed .APK, but I do not understand where to find Android Key Hash of my app on Mac?

Can anyone point me to right direction please.

解决方案

I am not a Mac user so won't be able to give you a solution specifically for a Mac, but I can give you something better and simpler.

I have posted a similar answer here: https://stackoverflow.com/a/13283088/450534. The second solution works regardless to the platform.

Give this a try. This is the exact same from the answer linked above.

I always found the simplest thing to do was, let the Facebook SDK tell you what your Hash Key is. This is by far more simpler and shouldn't take more than a couple of minutes.

Step 1: In your Facebook SDK, locate the Util.java class. In that, change this:

private static boolean ENABLE_LOG = false;

to:

private static boolean ENABLE_LOG = true;

Step 2: Create a new Signed APK, transfer to your device and install. If it is already installed, naturally, it will prompt.

Step 3: With your DDMS (Logcat) running and your device connected to the computer, run the application and keep looking for a key mismatch warning. That warning has the actual Hash Key. Copy that key, go to your Facebook Developer page and add the new key to the list.

You might also want to go through the comments from this answer of mine. https://stackoverflow.com/a/10516629/450534. In the third comment, the OP has posted the response in Logcat.

EDIT: The official Facebook Getting Started - Step 4 pages provides this command for generating a Key Hash on a Mac:

keytool -exportcert -alias androiddebugkey -keystore ~/.android/debug.keystore | openssl sha1 -binary | openssl base64

这篇关于在Mac上为Android应用签名Android应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆