Android Debugging help!


#1

Hi all. So like most, I’m new to android … I apologize for that :slight_smile:

But to get straight to my issue. I have an existing cocos2dx project (a friend’s project I’m helping out with). This project already runs on Android. I have gone through all the steps to setup up Eclipse, etc., I can build and deploy no problems.

Now, my task is to use JNI to interface some systems between java and native C. So I researched that, wrote some code that seems like it should work, and am trying to test it. Only, when the c*+ code calls the java code, it crashes. So naturally I think, oh this will be easy, let me just fire up the debugger and see what’s happening; but apparently it’s not that easy. I’ve been digging through miles of forum posts, articles, and configurations trying to figure out how to do this, and I can’t. Before I post the dozen or so different approaches I’ve been through on this issue, is there a “right” way that someone knows to make this work?
I’ve got all the c*+ extensions I need (I think) in eclipse, I’ve set up the c++ configurations, I’ve even gone so far as to compile the app completely in eclipse (which is where I’m at now with some path problems). So if there’s a real way to do this, please help!

FWIW on my system specs: I’m working in windows xp using cygwin and the latest nkd (r8d as of the time of this writing).


#2
  1. You could use the logcat. Plug in your device and open up the CMD or the Terminal and run logcat (type in “adb logcat”).
  2. Use the ndk-stack. It’s located in the Android NDK in your machine. under the folder “tools”. Read the red me to know how to use it.