我正在尝试将ndk-gdb附加到我的Android应用程序。无法将ndk-gdb附加到Android应用程序
我使用的是Android-ndk-r6b
,设备是Android 2.3,Samsung Galaxy S II。
我跟着这个例子Click here for the example
而且我也试图与一个应用程序,当我试图附加GDB与其他应用程序,但详细的显示出它总是越来越重视到第一应用程序本身的所有步骤
Found package name: <1st attached package name>
我尝试使用这个命令首次推出ndk-gdb
:
ndk-gdb --start --force --verbose
我试图连接到另一个应用程序使用下面的命令,但没能成功:
ndk-gdb --launch=com.example.hellogdbserver.HelloGdbServer --force --verbose
我总是提示以下错误:与第一个应用程序:
ERROR: Non-debuggable application installed on the target device.Please re-install the debuggable version!
这完全是外壳的日志我我越来越
sh-4.1$ ndk-gdb --verbose --start --force
Android NDK installation path: /cygdrive/c/Android/android-ndk
Using default adb command: /cygdrive/c/Android/android-sdk-windows/platform-tools/adb
ADB version found: Android Debug Bridge version 1.0.26
Using final ADB command: '/cygdrive/c/Android/android-sdk-windows/platform-tools/adb'
Using auto-detected project path: /cygdrive/d/EclipseTestWorkspace/hello-gdbserver
Found package name: com.example.hellogdbserver
ABIs targetted by application: armeabi
Device API Level: 10
Device CPU ABIs: armeabi-v7a armeabi
Compatible device ABI: armeabi
Found debuggable flag: true
Found device gdbserver: /data/data/com.example.hellogdbserver/lib/gdbserver
Using gdb setup init: /cygdrive/d/EclipseTestWorkspace/hello-gdbserver/libs/armeabi/gdb.setup
Using toolchain prefix: /cygdrive/c/Android/android-ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/arm-linux-androideabi-
Using app out directory: /cygdrive/d/EclipseTestWorkspace/hello-gdbserver/obj/local/armeabi
ERROR: Could not extract package's data directory. Are you sure that
your installed application is debuggable?
sh-4.1$
请让我知道如何解决上述错误,以及如何附加到新的软件包。
我的手机没有植根。希望这不会影响gdb。
这也没有帮助Link to similar problem。由于我的手机是新手机,没有任何应用程序,除了目前正在开发的应用程序。 (仅与三星手机一起去包都存在。没有应用程序是从市场下载。)
感谢&问候,
SSuman185
请通过链接Debugging native code in android app using the android ndk gdb
看到我的三星注入相同。你有没有找到解决办法? – Androider
您是否尝试过在清单中设置 android:debuggable =“true”>? –
Lennart
是的,我已经把这个标志设置为true - –
Suman