Discussion:
Updating "Profile or Debug APK…" APK in Android Studio
Andi McClure
2018-12-08 20:15:57 UTC
Permalink
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
steps— I have to click "Select library to add debug symbols" and drag in
all the .so files I built, and 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 Android
studio, it doesn't run "build B". It continues running "build A", the APK
and .so's seem to be the ones that

, the program that i'm running in my "Profile and Debug APK
" project
isn't the most recently compiled one. It seems to be the one that existed
at the time I originally clicked "Profile and Debug APK
" in Android
Studio. I can click "Profile and Debug APK
" and create a new project, but
then every single time I have to do all these steps.

Is there a way to tell an ? There is a task "
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/af5fd856-637e-4419-aba2-6e2b9030c574%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Andi McClure
2018-12-08 20:31:31 UTC
Permalink
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
--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk+***@googlegroups.com.
To post to this group, send email to android-***@googlegroups.com.
Visit this group at https://groups.google.com/group/android-ndk.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-ndk/25363d99-3e88-46a7-a8df-445d8a1fbb60%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...