ndk-gdb是否可在macOS Sierra下工作? [英] Does ndk-gdb work under macOS Sierra?
问题描述
我正在尝试调试启用了USB调试的运行Android 6.0.1的Huawei Honor手机.
I'm trying to debug a Huawei Honor phone, running Android 6.0.1, with USB debug enabled.
尝试在任何Android设备上使用ndk-gdb总是会给我:
Trying to ndk-gdb on any Android device will always give me:
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
:
Note that I had to use sudo
like this:
sudo ndk-gdb --force --verbose --launch
否则在gdb下我会得到
otherwise under gdb I would get
Unable to find Mach task port for process-id 44415: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
然后在gdb下,用run
运行可执行文件给我:
Then under gdb, running the executable with run
give me:
(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.
从此版本开始:在macOS Sierra 10.12.4上的gdb
我收集到gdb与macOS Sierra存在问题.我在使用ndk-gdb遇到同样的问题吗?
I gathered that gdb has issues with macOS Sierra. Am I hitting the same issue with ndk-gdb?
推荐答案
因此,事实证明该问题有两个方面:
So it turns out that the issue is two-fold:
- 真正的问题是无法连接到设备"之一,由
OEM锁定了调试功能.它一定要是
植根以便能够与ndk-gdb连接. Windows上的调试也是如此.因此,这与macOS无关.
sudo
命令无用且无关紧要. - 该体系结构警告是由于我忘记将新版本(从我的应用程序的不同版本)部署到手机上,导致已经安装在手机上的应用程序已过时.通过
ant debug install
进行另一次部署后,该警告现在消失了.
- The real problem is the "unable to connect to device" one, caused by
the fact that the OEM locked the debug capability. It has to be
rooted to be able to connect with ndk-gdb. The same applies to debugging on Windows too. So this is unrelated to macOS. The
sudo
command is useless and irrelevant. - The architecture warning was due to the fact that I forgot to deploy the new build (from a different version of my app) to the phone, so that the app already-installed on the phone was outdated. After another deployment through
ant debug install
, the warning is now gone.
我认为问题已经解决.但是,出现了一个新问题:
I consider the issue now solved. However, a new issue appeared:
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
这将引起另一个问题.
这篇关于ndk-gdb是否可在macOS Sierra下工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!