1

I'm trying to debug an native app on my android device. I followed this tutorial: http://blog.thecobraden.com/2012/02/debugging-apps-with-native-code-part-1_09.html And everything went good, I built the app and installed it, once I wanted to debug it with ndk-gdb I got this error: Could not open remote device: Invalid argument.

I searched this error and found this answer: Android NDK debugging: device can't be opened It's very similar to my problem, I tried this method and now I get this error: Can't open socket: Permission denied.

My phone is rooted so I don't understand why gdbserver can't open the socket.. I tried to give the gdbserver binary different permissions but it still won't work. Any solutions?

Community
  • 1
  • 1
makemefear
  • 11
  • 2

1 Answers1

0

Are you running the ndk gdb command as root? Do adb root to get the root access of the device and then start the debugging. Hopefully this should help.

G3M
  • 1,023
  • 8
  • 19
  • Yes, I run ndk-gdb as root. Before the debugging I did adb root to run the service on the phone as root, and it still didn't work. It is very strange, because the native app have permissions for Internet, and gdbserver runs with the permissions of the app, so it must work. – makemefear Oct 14 '14 at 18:52