Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging native code in Android on the *device* (not emulator)

I followed this description for debugging native code in an Android app and it works when debugging on the emulator.

When I want to debug on the actual device, at the point where I switch to the C/C++ debug configuration, Eclipse reports "Remote communication error: Bad file descriptor.". Apparently there's a problem reaching GdbServer (I guess). I suppose all that's missing is a small tweak to the debug configuration. Unfortunately, I don't yet really understand how the whole setup works, so I'm unable to pinpoint/solve the problem. Any help would really be appreciated.

like image 844
Dabbler Avatar asked Dec 11 '11 10:12

Dabbler


People also ask

Which tools are used for debugging on the Android platform?

Android Debug Bridge (adb) is a versatile command-line tool that lets you communicate with a device. The adb command facilitates a variety of device actions, such as installing and debugging apps, and it provides access to a Unix shell that you can use to run a variety of commands on a device.


2 Answers

Assuming you're on an ARM Android, you may have better luck with the free ARM-supplied Android debugger: http://ds.arm.com/ds-5-community-edition/

like image 124
android.weasel Avatar answered Sep 28 '22 12:09

android.weasel


You can get that error if you don't run ndk-gdb to start gdbserver on the device. Here a link to an explaination of how the android remote debugging works: http://mhandroid.wordpress.com/2011/01/25/how-cc-debugging-works-on-android/

like image 20
Tod Avatar answered Sep 28 '22 11:09

Tod