【问题标题】:The latest ndk-gdb can not connect to my device最新的ndk-gdb无法连接到我的设备
【发布时间】:2017-07-17 21:05:32
【问题描述】:

我只是在使用 ndk-gdb 调试我的本机应用程序时遇到了麻烦。这是我的环境:

  • OS X El Captain 10.11.5
  • NDK 版本 r12
  • SDK 版本 24
  • 构建工具版本 24.0.0
  • 使用 Android N (NPD35K) 的设备 Nexus 6P

问题:

当我要启动 ndk-gdb 时,它总是失败并显示消息

Error: unable to connect to device.
Remote connection closed

但是,自从我的应用暂停后,gdbserver 实例已经启动,我可以在adb shell ps 列表中看到gdbserver

我尝试过的:

  1. 我没有通过 ndk-gdb 脚本启动 gdbserver,而是启动了 gdbserver 手动由 adb run-as 并确保 gdbserver 继续运行
  2. 通过adb forward :5039 localfilesystem:/the_gdb_socket_path转发套接字

  3. 使用netstat -na | grep 5309 确保端口正在侦听

  4. 使用telnet localhost 5039 测试socket 但得到错误Connection closed by foreign host

有没有更好的方法来确定导致远程 gdb 连接失败的问题所在?

【问题讨论】:

标签: android-ndk adb ndk-gdb


【解决方案1】:

在我的情况下,我必须 root 手机来解决该连接问题,请参阅: Does ndk-gdb work under macOS Sierra?

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-02-27
    • 1970-01-01
    • 1970-01-01
    • 2014-01-31
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多