调试Android开源操作系统

发布于 2024-11-28 05:09:04 字数 1468 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

云醉月微眠 2024-12-05 05:09:04

如果您以 root 身份运行(模拟器中的正常情况,可能在开发手机上或通过可能的消费者手机上的安全漏洞),您可以将 gdb (实际上是 gdbserver)附加到几乎任何已经运行的用户空间进程。请注意,许多事情可能会对暂停任何有用的时间长度产生不良反应。

如果您不是以 root 身份运行,则只能调试以您可以说服运行 gdbserver 的用户身份运行的进程 - 即使用 adb 启动的进程,或者使用使用 adb 构建的应用程序的 run-as 工具应用程序进程设置调试标志并具有 Internet 权限(用于 gdb-gdbserver 通信)。

如果你想调试内核,你需要弄清楚如何让 kgdb 工作,或者更有可能只是在有趣的地方加载 printk。这当然需要能够重建和重新安装内核。

If you are running as root (normal case in the emulator, possible on dev phones or via security holes on may consumer ones), you can attach gdb (actually, gdbserver) to almost any already running userspace process. Be aware many things may react poorly to being paused for any useful length of time.

If you aren't running as root you can only debug processes running as a user that you can convince to run gdbserver - ie, those you launch with adb, or by using the run-as tool application processes of apps that were built with the debug flag set and have Internet permission (for gdb-gdbserver communication).

If you want to debug the kernel you would need to either figure out how to get kgdb working, or more likely just load up with printk's in interesting places. This of course requires the ability to rebuild and reinstall the kernel.

遗忘曾经 2024-12-05 05:09:04

不要使用模拟器,这会浪费您的宝贵时间。
购买一部 Android 手机,调试将变得如您所愿,既快速又简单。

Don't use emulator, it's a waste of your precious time.
Get an android phone and the debugging will be as fast and easy as you love to.

飘落散花 2024-12-05 05:09:04

这取决于您的桌面情况,但可以通过增加 来改进模拟器模拟器RAM。虽然不是很好,但会改进。

要在设备上进行调试,请使用 USB 电缆将其连接到计算机。当您通过 Eclipse 运行该项目时,它将提示您在哪个设备/模拟器上运行,在这种情况下您选择您的手机。然后您将切换到“调试”透视图。

It depends on your desktop situation, but the emulator can be improved by increasing the emulator RAM. It isn't great, but it will be improved.

To debug on your device, connect it to your computer with its USB cable. When you run the project through Eclipse, it will prompt for which device/emulator to run on, in which case you select your phone. You would then switch to the Debug perspective.

來不及說愛妳 2024-12-05 05:09:04

当然。

只要你有 Eclipse IDE,这很容易。您只需在调试中运行程序并转到 DDMS 选项卡即可。

一些对您有帮助的链接:

http://www.droidnova。 com/debugging-in-android-using-eclipse,541.html

http://developer.android.com/guide/developing/debugging/index.html

编辑:
我猜你必须下载并编译 Android 源代码才能达到你的目的。此链接可能会对您有所帮助: http://source.android.com/source/initializing.html< /a>

Sure.

It's easy as long as you have Eclipse IDE. You just have to run your program in debug and go to DDMS tab.

Some links that will help you:

http://www.droidnova.com/debugging-in-android-using-eclipse,541.html

http://developer.android.com/guide/developing/debugging/index.html

EDIT:
I guess you will have to download and compile the Android sources for your purposes. This link will probably help you: http://source.android.com/source/initializing.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文