签署apk的 - 这是什么意思,我该怎么做? [英] Signing apk's - what does it mean and how do I do it?

查看:151
本文介绍了签署apk的 - 这是什么意思,我该怎么做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我问有关SO的问题,唯一的建议答案涉及以下内容:注册调试证书并使用该调试api密钥。



不幸的是,我几乎不知道这是什么意思,不能理解如何做。我已经阅读这个谷歌页面,但它似乎假定了一些事先我没有的知识,也没有举个例子。有没有一个更友好的指南可以帮助我?



编辑:我的最终目标是能够调试一个签名的应用程序。 p>

编辑:通常,当我想调试一个应用程序时,我可以在运行应用程序之前的eclipse 中查看源代码,然后设置一些断点。然后我运行应用程序,可以逐行地逐步执行代码或从一个断点跳转到下一个断点。在这个(和类似的)SO问题中,我已经通过使用eclipse的DDMS视图来看过调试的调试,运行一个已经导出和签名的apk,然后将调试器附加到进程。这让我感到困惑,因为我不能理解我如何看到相应的源代码设置断点...我的程序在启动后很快崩溃 - 我猜这可能会增加调试的难度。 p>

解决方案

手册很清楚。请指出你工作后遇到什么部分,我建议:



http://developer.android.com/guide/publishing/app-signing.html



好的,一个小的概述,没有参考或日食,所以留下一些空间的错误,但它的工作原理如下




  • 打开您的项目在eclips

  • 按右键,工具(android工具?) - >导出签名的应用程序(apk?)

  • 通过wizzard :

  • 制作新的密码库。记住密码

  • 签署您的应用程序

  • 保存等。



另外,从链接


使用Eclipse ADT编辑并签名



如果您使用Eclipse与ADT
插件,您可以使用导出向导
导出已签名的.apk(甚至
创建一个新的密钥库,如果需要)。
导出向导会为您执行与Keytool和
Jarsigner的所有
交互,这允许您使用GUI代替
签署包,而
执行手册程序到
编译,签名和对齐,如上面讨论的
。一旦向导编译
并签署了您的包,它也将$ b​​ $ b perfom包与
zipalign对齐。因为导出向导
使用Keytool和Jarsigner,所以
应该确保它们可以在您的计算机上访问
,如上所述,基本设置签名中的



中创建一个签名和对齐的.apk Eclipse:


  1. 选择该项目在包资源管理器中,并选择文件>
    导出。

  2. 打开Android文件夹,选择导出Android应用程序,然后单击
    下一步。 p>

    导出Android应用程序向导现在启动,这将引导
    您通过签署
    您的应用程序的过程,包括步骤
    选择私人密钥,
    用于签署.apk(或创建一个新的
    密钥库和私钥)。


  3. 完成导出向导和您的应用程序将被编译,
    签署,对齐,并准备
    分发。


修改



DDMS不是源代码调试器,它提供:




  • 端口转发服务

  • 设备上的屏幕截图

  • 设备上的线程和堆信息

  • logcat ,流程和无线电状态信息

  • 来电和短信欺骗

  • 位置数据欺骗



另一方面,使用Eclipse可以在代码中设置断点。


I asked a question on SO for which the only suggested answer involved the following: "register the debug certificate and use that debug api key."

Unfortunately I scarcely know what that means and can not fathom how to do it. I did read this google page, but it appears to assume some prior knowledge which I don't have, and it gives no examples. Is there a friendlier guide somewhere that could help me?

EDIT: my ultimate aim is to be able to debug a signed app.

EDIT: Normally when I want to debug an app I can view the source in eclipse before running the app and then set some break points. Then I run the app and can step through the code either line by line or jumping from one breakpoint to the next. In this (and similar) SO questions I have seen discussions of debugging via using eclipse's DDMS view, running an already exported and signed apk and then "attaching" the debugger to the process. This is confusing me because I can not fathom how I ever get to see the corresponding source code to set up breakpoints... also my program crashed pretty quickly after starting - which I guess could add to the difficulty in debugging this way.

解决方案

The manual is clear enough. Please specify what part you get stuck with after you work trought it, I'd suggest:

http://developer.android.com/guide/publishing/app-signing.html

Ok, a small overview, without reference or eclipse around, so leave some space for errors, but it works like this

  • open your project in eclips
  • press right-mouse, tools (android tools?) - > export signed application (apk?)
  • go trough the wizzard:
  • make a new key-store. remember that password
  • sign your app
  • save it etc.

Also, from the link:

Compile and sign with Eclipse ADT

If you are using Eclipse with the ADT plugin, you can use the Export Wizard to export a signed .apk (and even create a new keystore, if necessary). The Export Wizard performs all the interaction with the Keytool and Jarsigner for you, which allows you to sign the package using a GUI instead of performing the manual procedures to compile, sign, and align, as discussed above. Once the wizard has compiled and signed your package, it will also perfom package alignment with zipalign. Because the Export Wizard uses both Keytool and Jarsigner, you should ensure that they are accessible on your computer, as described above in the Basic Setup for Signing.

To create a signed and aligned .apk in Eclipse:

  1. Select the project in the Package Explorer and select File > Export.
  2. Open the Android folder, select Export Android Application, and click Next.

    The Export Android Application wizard now starts, which will guide you through the process of signing your application, including steps for selecting the private key with which to sign the .apk (or creating a new keystore and private key).

  3. Complete the Export Wizard and your application will be compiled, signed, aligned, and ready for distribution.

EDIT:

DDMS is not a source code debugger, it provides:

  • port-forwarding services
  • screen capture on the device
  • thread and heap information on the device
  • logcat, process, and radio state information
  • incoming call and SMS spoofing
  • location data spoofing

On the other hand, with Eclipse you can set breakpoints in your code.

这篇关于签署apk的 - 这是什么意思,我该怎么做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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