Issue
I'm trying to debug a Huawei Honor phone, running Android 6.0.1, with USB debug enabled.
Trying to ndk-gdb on any Android device will always give me:
Error: unable to connect to device.
Remote connection closed
A little before this I also see:
warning: Selected architecture aarch64 is not compatible with reported target architecture arm
warning: Architecture rejected target-supplied description
Note that I had to use sudo
like this:
sudo ndk-gdb --force --verbose --launch
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))
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.
From this one: gdb on macOS Sierra 10.12.4
I gathered that gdb has issues with macOS Sierra. Am I hitting the same issue with ndk-gdb?
Solution
So it turns out that the issue is two-fold:
- 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
This will go into another question.
Answered By - kakyo
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.