【问题标题】:Does ndk-gdb work under macOS Sierra?ndk-gdb 可以在 macOS Sierra 下工作吗?
【发布时间】:2017-12-20 18:44:57
【问题描述】:

我正在尝试调试华为荣耀手机,运行 Android 6.0.1,启用 USB 调试。

在任何 Android 设备上尝试 ndk-gdb 总是会给我:

Error: unable to connect to device.
Remote connection closed

在此之前我还看到:

warning: Selected architecture aarch64 is not compatible with reported target architecture arm
warning: Architecture rejected target-supplied description

请注意,我必须像这样使用sudo

sudo ndk-gdb --force --verbose --launch

否则在 gdb 下我会得到

Unable to find Mach task port for process-id 44415: (os/kern) failure (0x5).
 (please check gdb is codesigned - see taskgated(8))

然后在gdb下,运行带有run的可执行文件给我:

(gdb) run
Starting program:  /path/to/my/ndk-project-root/obj/local/arm64-v8a/system/bin/app_process64
During startup program terminated with signal SIG113, Real-time event 113.

来自这个:gdb on macOS Sierra 10.12.4

我收集到 gdb 与 macOS Sierra 存在问题。我是否遇到了与 ndk-gdb 相同的问题?

【问题讨论】:

    标签: android c++ macos android-ndk gdb


    【解决方案1】:

    所以事实证明这个问题有两个方面:

    1. 真正的问题是“无法连接到设备”之一,由 OEM 锁定调试功能的事实。它一定要是 植根于能够与 ndk-gdb 连接。这同样适用于 Windows 上的调试。所以这与macOS无关。 sudo 命令无用且无关紧要。
    2. 架构警告是由于我忘记将新版本(从我的应用程序的不同版本)部署到手机,因此手机上已安装的应用程序已过时。通过ant debug install 进行另一次部署后,警告现在消失了。

    我认为这个问题现在已经解决了。但是,出现了一个新问题:

    warning: Could not load shared library symbols for 142 libraries, e.g. /system/lib64/libcutils.so.
    Use the "info sharedlibrary" command to see the complete listing.
    Do you need "set solib-search-path" or "set sysroot"?
    0x0000007f93f84a20 in syscall ()
       from /Applications/Audiokinetic/Wwise_2017.1.0.6240/SDK/samples/IntegrationDemo/Android/obj/local/arm64-v8a/system/lib64/libc.so
    

    这将进入另一个问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-06
      • 2018-08-06
      • 2023-03-15
      • 1970-01-01
      • 1970-01-01
      • 2017-03-13
      • 1970-01-01
      相关资源
      最近更新 更多