Thursday, 19 July 2012

Android NDK debugging - on the Mac

I've been very busy the past couple of days, figuring-out how to track-down a bug in some JNI code.
I've installed a new Google "NDK Plugins" tool for Eclipse... that works rather well, and is well worth investigating if you need to debug Android JNI code from Mac, Windows or Linux.

I had to install Eclipse 3.7 (I had been using 3.6...), and made sure to select the NDK Plugins option when installing the Android tools.

I also had to:
- turn-off all C++ building and code analysis from the Eclipse side
- set android:debuggable="true" in the AndroidManifest.xml
- right click project, select Debug -> Android Native...
- The breakpoints aren't hit; but I DO get the debugger fire-in when the code goes wrong!