如何为我的 Android Market APK 创建证书? [英] How Do I Create A Certificate For My Android Market APK?

查看:20
本文介绍了如何为我的 Android Market APK 创建证书?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将我的第一个 APK/应用程序上传到 Android 电子市场,但是我收到了这个错误(顺便说一下,在 stackoverflow 中搜索时并没有让我找到正确的链接).

I want to upload my first APK/app to the Android Market, but I got this error (which did not lead me to the correct link when searched for in stackoverflow, by the way).

Market 不接受使用调试证书签名的 apk.创建有效期至少为 50 年的新证书.Market 要求用于签署 apk 的证书的有效期至少要到 2033 年 10 月 22 日.创建一个新证书.

虽然结果证明这个问题是相似的,那家伙只是说哦,你让我想起了怎么做"而没有实际解释.我查看了答案"中提到的网站,但这是我的问题:

Though it turns out this question is similar, the guy just says "Oh, you reminded me of how to do it" without actually explaining. I've looked at the website referred to in the "answer", but here's my problem:

  • 我不知道我的 keytool 工具在哪里.Android 网站 非常含糊;我在 ..android-sdk-windows ools 目录中没有看到任何类型的keytool".
  • 我想我以前已经这样做过,但我希望我有一组类似于打开命令提示符,导航到 keytool 所在的目录,输入命令 'xyz -flagsforxyz',然后从 Eclipse 中的export release apk"选项指向密钥库"...或类似的东西.
  • I don't know where my keytool tool is. The Android site is pretty vague; I don't see "keytool" of any sort in my ..android-sdk-windows ools directory.
  • I think I've done this before, but I wish I had a set of steps that is like "Open up a command prompt, navigate to the directory where keytool is, enter in command 'xyz -flagsforxyz', and then point to the keystore from the 'export release apk' option in Eclipse"... or something similar.

我希望你能说我已经尝试了一些东西!我可能只是忽略了一些简单的事情——所以是时候在 stackoverflow 中记录这些步骤了!谢谢你的帮助.

I hope you can tell that I've tried a few things already! I might just be overlooking something simple -- so it's time for the steps to be recorded in stackoverflow! Thanks for your help.

推荐答案

如果您使用的是 Eclipse for Development,只需右键单击您的项目并单击导出.现在选择 Android,然后选择导出 Android 应用程序.在下一步中,确认要导出的项目.然后单击下一步,现在您应该能够选择创建新的密钥库.现在填写必填字段,您应该能够签署您的应用程序.请务必备份密钥库文件并记住您的密码.丢失此信息将无法更新您的应用程序.

If you are using Eclipse for Development just right click on your project and click export. Now choose Android and then Export Android Application. In the next step confirm the project that you want to export. Then click next and now you should be able to select create new keystore. Now fill in the required fields and your should be able to sign your app. Be sure to make a backup of the keystore file and remember your password. Losing this will make it impossible to update your application.

如果您使用终端创建密钥库并且安装了 Java SDK,则/usr/bin 中应该有一个名为 keytool 的程序(在基于 unix 的系统上).在 Windows 上,SDK 也应该随 keytool 一起提供,但如果 keytool 不在您的路径中,则安装位置可能与您计算机上的 keytool.exe 搜索不同.使用此工具,您应该能够通过以下方式创建密钥:

If you are using the terminal to create a keystore and you have Java SDK installed there should be a program called keytool in /usr/bin (on a unix based system). On Windows the SDK should also come with the keytool but the install location may be different search for keytool.exe on your computer if keytool is not in your path already. With this tool you should be able to create a key in the following way:

keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -validity 10000

请记住,一旦您的证书丢失或过期,您将无法签署您的申请.确保到期日期在未来很长一段时间.

Remember that once you lose your Certificate or it expires you will not be able to sign your application. Make sure that the expiration date is a long long time in the future.

这篇关于如何为我的 Android Market APK 创建证书?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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