如何签署使用 PhoneGap Build 构建的 Android APK?

如何签署使用 PhoneGap Build 构建的 Android APK?

问题描述:

PhoneGap Build 似乎是一个很棒的工具,我已经用它构建了一个 .apk 并在多个 Android 设备上对其进行了测试.

PhoneGap Build seems like a great tool and I've build an .apk with it and tested it on multiple Android devices.

现在我需要将它提交到 Google Play 商店,但我需要对 apk 进行签名.

Now I need to submit it to the Google Play store but I need to sign the apk.

我已经在 Google 的开发者网站上阅读了有关签署 .apk 的所有内容,但似乎我需要安装 Android 开发工具并使用 Eclipse.我已经安装了它,但我找不到导入我的 .apk 的方法,所以我被卡住了.

I've read all about signing an .apk on Google's developer site but it seems that I need to install the Android development tools and use Eclipse. I've installed it but I can't find a way to import my .apk so I'm stuck.

我不明白 - 那么 PhoneGap Build 的意义何在?

I don't get it - what is the point of PhoneGap Build then?

这一切都非常令人沮丧.该应用程序已准备就绪,但...

This is all very disheartening. The app is ready to go but...

这就是解决方案.

我得到了 Android 开发工具包 - http://developer.android.com/sdk/index.html

I got the Android dev kit - http://developer.android.com/sdk/index.html

从那里我使用这个视频来获取 KeyTool:http://www.youtube.com/watch?v=IaXE2FUENFI

From there I used this video to get KeyTool: http://www.youtube.com/watch?v=IaXE2FUENFI

从那里我可以创建一个 KeyStore.确保记录别名和密码(我把它们写下来,没有存储在任何电子设备上)和密钥库的位置.

From there I could create a KeyStore. Make sure you keep a record of the Alias and Password (I wrote them down and did not store them on any electronic device) and the location of the keystore.

当您在 PhoneGap Build 中并在构建完成后从 GitHub 中提取文件(我就是这样做的)时,您会看到有一个下拉列表.选择添加密钥"并上传您的密钥库.

When you are in PhoneGap Build and you pull files from GitHub (which is the way I'm doing it) after the build is done you'll see there is a dropdown. Select "add a key" and upload your keystore.

注意:密钥库通常会被锁定.您必须解锁它才能使用它进行构建.它只能保持解锁状态一小时.

Note: The keystore will usually be locked. You have to unlock it in order to build with it. It only stays unlocked for one hour.

You PhoneGap Build apk 现在将附加 -release 而不是通常的 -debug.

You PhoneGap Build apk will now be appended with -release instead of the usual -debug.

现在可以上传到 Google Play!

It's now ready for uploading to Google Play!

开始建造!:)