[英]Why is attaching gdbserver to a native android app failing?
I am developing a fully native application in using C++ and pure CMake as the build system - no Android Studio involved at all (proof of concept here )我正在开发一个完全原生的应用程序,使用 C++ 和纯 CMake 作为构建系统 - 完全不涉及 Android Studio(概念证明在这里)
The code builds, apk is generated and can be installed and run via ADB without issue but I cannot get gdbserver64 to attach to the process for debugging.代码构建,apk 生成,可以通过 ADB 安装和运行,没有问题,但我无法让 gdbserver64 附加到进程进行调试。
More details:更多细节:
android:debuggable="true"
in manifestandroid:debuggable="true"
But every time I try gdbserver64:5039 --attach $(pidof my.app.id)
但每次我尝试
gdbserver64:5039 --attach $(pidof my.app.id)
I get /bin/sh: <app_pid>: inaccessible or not found
我得到
/bin/sh: <app_pid>: inaccessible or not found
What am I missing?我错过了什么? And no, I cannot just move to Android Studio - this is a cross platform project that needs to be buildable using only CMake.
不,我不能只移动到 Android Studio - 这是一个跨平台项目,需要仅使用 CMake 即可构建。
According to my observation, this may be a bug of prebuilt gdbserver.根据我的观察,这可能是预建的 gdbserver 的一个错误。 It treats the parameter after --attach as a program name and tries to start it.
它将 --attach 之后的参数视为程序名称并尝试启动它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.