ndk-gdb 失败并显示消息:无效的属性名称:包
将 Nexus One 连接到运行 Snow Leopard 的 Mac。 从 Eclipse 运行“调试”。显示 Nexus One 上负载的执行情况
/usr/local/android-ndk-r5b/ndk-build NDK_DEBUG=1
良好。然后我尝试运行调试器,这样我就可以进入 JNI 层:
$ $NDK_DIR/ndk-gdb
失败,并显示以下消息:
Invalid attribute name:
package
Invalid attribute name:
package
Invalid attribute name:
package
ERROR: Non-debuggable application installed on the target device.
Please re-install the debuggable version!
所以我检查了 bin 中的 apk,它
lib/armeabi/gdbserver
查看了 ndk-dbg 脚本,这条消息意味着它在尝试查找 gdbserver 时失败电话。所以我尝试手动执行一些 ls 命令:
$ adb shell ls /data
opendir failed, Permission denied
所以我查看了 /data ,权限是 771。
我做错了什么才能达到这一点?
Connect Nexus One to Mac running Snow Leopard.
Run "debug" from Eclipse. Shows the execution of
/usr/local/android-ndk-r5b/ndk-build NDK_DEBUG=1
Loads on Nexus One fine. Then I try to run the debugger so I can get to the JNI layer:
$ $NDK_DIR/ndk-gdb
Fails with these msgs:
Invalid attribute name:
package
Invalid attribute name:
package
Invalid attribute name:
package
ERROR: Non-debuggable application installed on the target device.
Please re-install the debuggable version!
So I checked the apk in bin and it has
lib/armeabi/gdbserver
Looked at the ndk-dbg script, and this message means it's failing trying to find gdbserver on the phone. So I tried to do some ls commands by hand :
$ adb shell ls /data
opendir failed, Permission denied
So I looked at /data and the permissions are 771.
What have I done wrong to get to this point?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
AndroidManifest.xml 文件具有 Windows 回车控制 (\r\n),这会弄乱 ndk-gdb 脚本。为了解决这个问题,我在 vi 中编辑了该文件并执行了
“set filetype=unix”
。The AndroidManifest.xml file had Windows carriage control (\r\n) which was messing up the ndk-gdb script. To fix this, I edited the file in vi and did a
"set filetype=unix"
.另一个解决方法是将 libs/armeabi/gdbserver 推送到 root 设备上的 /data/data/your.pkg/lib 。
Another workaround is to push libs/armeabi/gdbserver to /data/data/your.pkg/lib on a rooted device.