Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to debug a native Android app?

I've installed the Sequoyah Android Native Support, and now, I can execute the debug mode. I have a breakpoint in the same line where I call a native method, so when I execute the debug Java mode, eclipse stops in this line, I execute the 'ndk-gdb', and I lunch the C/C++ debug mode, I see the console do something. But, how can I put C breakpoints? Because my C code is a .so library, so I can't put breakpoints in this file. I have a JNI floder where there are .c and .h files, but don't stops when I put breakpoints. Eclipse log recognizes breakpoints, but prints error.

break-insert com_example_pruebaffmpeg_MainActivity.c:4323 error, msg="No symbol table is loaded. Use the \"file\" command."

like image 326
beni Avatar asked Sep 26 '12 11:09

beni


People also ask

Can you debug an APK?

With VisualGDB you can easily debug APK files built by other build environments. Just click "Android->Debug a Custom APK File", select an APK file, verify the library locations and click "Debug" to enjoy the power of Visual Studio debugger.

How can you debug your app when IT's already released?

Plug your phone into your computer and enable USB debugging on the phone. Open eclipse and a workspace containing the code for your app. In Eclipse, go to Window->Show View->Devices. Look at the Devices view which should now be visible, you should see your device listed.


1 Answers

Have you tried uninstalling Sequoyah and just using the ADT? As of version 20, the Eclipse ADT plugin can debug NDK projects more easily and reliably than the old Sequoyah way of doing things.

like image 176
LightStruk Avatar answered Oct 20 '22 19:10

LightStruk