Analogue of LD_DEBUG for zygote-spawned process

410 Views Asked by At

I'm wondering if Android has an option for user to enable LD_DEBUG-style logs for Zygote-spawned processes. Probably we can not start app_process for Zygote with customized environment without being a root user. So maybe there is some system property or maybe kind of linker API that allow to get dynamic linker logs for some debuggable Android package that may contain native libraries.

1

There are 1 best solutions below

0
Dan Albert On BEST ANSWER

aiui there isn't a way to do this on an un-rooted device until O.

Starting with O, you can add a wrap.sh to your (debuggable) APK to do things like this. I don't think we have any docs published for this yet, but it's sort of described here: https://github.com/android-ndk/ndk/issues/380#issuecomment-314223774