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)
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.
More details:
- App is built against SDK/NDK API level 30
- Attempting to debug on an Android 11 emulator instance without Google Play
- I can run adb root just fine
- Image already includes gdbserver and gdbserver64, attempting to use those
- Developer options and USB debugging enebled in emulator
- App has
android:debuggable="true"in manifest
But every time I try gdbserver64 :5039 --attach $(pidof my.app.id)
I get /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.