且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Android库项目中调试本机代码?

更新时间:2023-09-24 23:21:16

在我的问题中尝试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.