How to get ART in AOSP redirect stdio to logcat?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

How to get ART in AOSP redirect stdio to logcat?

I want to get stdout and stderr from system_server to show up in logcat since a number of native libraries have no real awareness they are running in Android and I'd like to debug them by examining their logging. From what I can tell by default stdout and stderr are redirected to /dev/null for processes spawned by the zygote in Android. I read that in older android versions you could use:

setprop log.redirect-stdio true

Which set -Xlog-stdio when starting dalvik. Recent Android versions using ART seem to no longer honor this property. Is there an alternative for recent Android versions that use ART?

I tried adding /system/bin/logwrapper to service zygote init command that starts the system server but I get this error:

Could not ctl.start for 'zygote': File /system/bin/logwrapper(labeled "u:object_r:system_file:s0") has incorrect label or no domain transition from u:r:init:s0 to another SELinux domain defined. Have you configured your service correctly?

This error appears even if I disable SELinux with setenforce 0. Perhaps there is some other mechanism in ART I'm not aware of?


You received this message because you are subscribed to the Google Groups "android-platform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit