DS-5: WHAT SETUP IS REQUIRED FOR ANDROID DEBUG
Information in this knowledgebase article applies to:
What setup is needed to use DS-5 for debugging Android native
(C/C++) applications and libraries?
You can use DS-5 with the Android Software Development Kit (SDK)
and Native Development Kit (NDK).
To install the Android SDK and NDK please refer to http://developer.android.com/index.html. Both
development kits contain examples on how to get started.
Once you have your Android application running on a device, you
can attach gdbserver to the process and start to debug native code
with DS-5 Debugger.
To debug with DS-5 Debugger you need to:
- Install the Android SDK and NDK.
Build the native code you want to debug with debug
- Start debugging your Java application on the device.
Upload a copy of
/system/bin/app_process from the
target on to the computer that the debugger runs on. This file is
needed by the debugger later on in order to find out which shared
libraries are loaded by the target system. You can use the
adb tool provided inside the Android SDK to transfer the
Open a shell to the device (again this can be done with
adb) and determine the process ID of the application
you want to debug.
gdbserver to the process i.e.
gdbserver --attach :port pid
Setup a DS-5 debug connection to load the symbols for
app_process, set the shared library search path
(location of the library on the host containing debug symbols) and
configure the debugger to connect only.
Connect DS-5 Debugger to gdbserver. (On the android emulator
you can forward the port to debug over using the
tool. In this case connect the debugger to IP address
Now you'll have two debug connections, one Java debug
connection and one DS-5 connection attached to the same
gdbserver 6.6, which is currently supplied
in the default Android file system, has insufficient support to debug
applications with multiple threads. You will need to upgrade to a
later version of
gdbserver if your application contains
Last Reviewed: Saturday, June 26, 2010