在Eclipse Android框架的调试 [英] Android framework debugging in Eclipse

查看:204
本文介绍了在Eclipse Android框架的调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我工作的地方,我在更改Android框架来源的项目。什么是做到这一点的Eclipse和能够调试的最佳方法?我见过的职位附加在Eclipse中的Andr​​oid源代码,但是这是标准源$ C ​​$ C,不是我自己的版本。

I'm working on a project where I'm making changes to the android framework sources. What's the best approach to do this in Eclipse and be able to debug? I've seen posts to attach the android source in Eclipse,but that's the 'standard' source code, not my own version.

目前,我只是更改文本编辑器的框架,并通过命令行构建每次运行命令行的仿真器和启动亚行logcat会议,看看是否有没有什么异常,但我们有了是另一种(更高效/可行的)的方式来做到这一点?

At the moment I just make changes to the framework in a text-editor and build via commandline every time, run the emulator from commandline and start a adb logcat session to see if there aren't any exceptions, but there's got to be another (more productive/workable) way to do this?

推荐答案

有一个解释如何安装调试器的官方文档,你可以找到的此处。在我的情况的步骤有所不同(的Eclipse 3.7.2和Android的最后工具):

There is an explanation how to attach debugger in the official documentation that you can find here. In my case the steps differ (Eclipse 3.7.2 and the last android tools):

  1. 运行>调试配置...
  2. 右键单击远程Java应用程序,选择新建。
  3. 选择一个你喜欢的名字,如机器人调试或任何东西。
  4. 将工程,你的android项目名称。
  5. 在保持主机设置为localhost,但更改端口8700。
  6. 单击调试按钮,你应该准备就绪。
  7. 然后去DDMS透视图,然后选择您要调试进程 (在进程列表中选中该进程,然后点击绿色的 错误图标)。如果你想测试你的服务,我认为这是一个 system_server 过程的一部分。
  8. 现在,您可以切换到调试透视图。
  1. Run > Debug Configurations...
  2. Right-click "Remote Java Application", select "New".
  3. Pick a name, i.e. "android-debug" or anything you like.
  4. Set the "Project" to your android project name.
  5. Keep the Host set to "localhost", but change Port to 8700.
  6. Click the "Debug" button and you should be all set.
  7. Then go to DDMS perspective and select a process you want to debug (select the process in the list of processes and then click on green bug icon). If you want to test your service, I think that it is a part of system_server process.
  8. Now you can switch to debug perspective.

要求保护的文档中:

一旦你这样做,你应该看到线程的列表;如果你选择一个,   打破它(通过单击暂停图标),它应该显示堆栈   跟踪,源文件和行执行的地方是。断点和   诸如此类的东西都应该工作。

Once you do, you should see a list of threads; if you select one and break it (by clicking the "pause" icon), it should show the stack trace, source file, and line where execution is at. Breakpoints and whatnot should all work.

这篇关于在Eclipse Android框架的调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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