如何在Android库项目中调试本机代码? [英] How to debug native code in an Android library project?

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

问题描述

我正在使用本地代码开发一个Android库。该库项目作为应用程序项目中的库添加。



当应用程序项目正在使用时,我想调试库。



我很确定库(makefile,build命令,编译器选项)项目中的设置是确定的,因为我在库内尝试了调试器(我创建了一个虚拟的Activity并取消设置库)它工作。我也知道由于加载动态库所需的时间可能会发生延迟,我不认为这是同样的原因。



应用程序项目,我刚刚添加本机代码支持将构建命令设置为 ndk_build NDK_DEBUG = 1 但它从不在断点处停止。任何想法都将不胜感激

解决方案

在我的问题中尝试Jay的答案:调试Android库中的本地代码
我没有时间用自己来测试,但是看起来很有希望。
让我知道如果它有效。


I am developing an Android library with native code. This library project is added as a library in an application project.

I would like to debug the library when the application project is using it.

I am pretty sure the settings in the library (makefiles, build command, compiler options) project are ok because I tried the debugger from within the library (I created a dummy Activity and unset "library") and it worked. I am also aware of the delay that might occur because of the time needed to load the dynamic library and I don't think it's the issue for the same reason.

In the Application project, I just added native code support set the build command as ndk_build NDK_DEBUG=1, but it never stops at breakpoints. Any idea would be greatly appreciated

解决方案

Try the answer by Jay in my question: debug native code in Android library. I had no time to test it by my self, but it looks promising. Let me know if it works.

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

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