I have a question about using Android Studio with NDK and I can't figure out where else to ask it…
I am building NDK Android apps at the command line. When I want to debug them, I follow these steps:
I build my app. Let's call this "build A". I open Android Studio and choose "Profile and Debug APK…" and select my APK. Then I have to do a bunch of setup steps— I have to click "Select library to add debug symbols" and drag in all the .so files I built, and because of a quirk of my test device I have to add an LLDB startup command to silence SIGILL. Then I can click the Debug button and debug my app. Okay, great.
But then there's a problem: The next time I build my app, the APK and the .so's that I've loaded don't "update". Say I change the code and rebuild at the command line. Let's call this "build B". If I click Debug in my window in Android studio, it doesn't run "build B". It continues running "build A", the APK and .so's seem to be the ones that existed at the time I originally said "Profile and Debug APK…", even though this is no longer the build on disk. (Also certain things seem to be broken at this point, but this is not consistent.)
I can click "Profile and Debug APK…" and create a new project and then I will be running "build B" and it will work, but then every single time I have to do all these setup steps.
Is there a way to tell one of these "Profile and Debug APK…" projects to reload the files from disk, so that I can debug "build B" and things will work the way they do when I recreate the project from scratch? If I right click the project or apk in the project view I notice there is a menu item "Synchronize Selected Files", but it does not appear to do anything.
Alternately, if I am building an NDK-heavy project from gradlew on the command line, is there a better way to run this in LLDB than to run "Profile and Debug APK…" and "Select library to add debug symbols" all my shared objects?
Thanks