库中调试本机代码

库中调试本机代码

本文介绍了在 Android 库中调试本机代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作区布局是:

.├── 应用程序库│ ├── AndroidManifest.xml│ ├── ...│ ├── jni│ ├── libs│ ├── ...│ └── src└── 应用├── AndroidManifest.xml├── ant.properties└── ……

如何在 Eclipse 中调试本机库?有人对此有所暗示吗?

解决方案

通过将未剥离的共享库/库的目录添加到调试器中的调试器,我能够在 Eclipse 上的 android 库中设置断点和调试本机代码配置对话框:

  1. 转到运行"菜单->调试配置"
  2. 在左侧窗格的Android Native Application"下,选择您的应用程序
  3. 在调试器"选项卡下,单击共享库"部分中的添加...".
  4. 浏览到您的 android 库项目目录并添加其子目录 obj/local/armeabi.
  5. 应用和调试.

这似乎对我有用.希望你也有同样的运气...

和平

My workspace layout is:

.
├── ApplicationLibrary
│   ├── AndroidManifest.xml
│   ├── ...
│   ├── jni
│   ├── libs
│   ├── ...
│   └── src
└── Application
    ├── AndroidManifest.xml
    ├── ant.properties
    └── ...

How can I debug the native library in Eclipse? Has anyone some hint about this?

解决方案

I was able to set breakpoints and debug native code in an android library on eclipse by adding the directory of the unstripped shared library/libraries to the debugger in the debug configurations dialog:

  1. Go to "Run" menu-> "Debug Configurations"
  2. Under "Android Native Application" in the left pane, select your application
  3. Under the "Debugger" tab click "Add..." in the "Shared Libraries" section.
  4. Browse to your android library project directory and add its subdirectory obj/local/armeabi.
  5. Apply and debug.

That seemed to work for me. Hopefully, you'll have the same luck...

Peace

这篇关于在 Android 库中调试本机代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-02 14:28