androidandroid-ndkdynamic-linkingbionic

Analogue of LD_DEBUG for zygote-spawned process


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.


Solution

  • 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