有时候第三方应用程序的日志输出是通过printf之类的标准函数输出的,logcat不能捕获到这些日志。一个技巧是使用logwrapper命令来执行第三方应用程序,logwrapper可以把标准输出重定向到adb log中去。(缺省级别是LOGI)
Usage: logwrapper [-x] BINARY [ARGS ...]
Forks and executes BINARY ARGS, redirecting stdout and stderr to
the Android logging system. Tag is set to BINARY, priority is
always LOG_INFO.
-x: Causes logwrapper to SIGSEGV when BINARY terminates
fault address is set to the status of wait()
Source for logwrapper is at: system/core/logwrapper/logwrapper.c
例如,在adb shell下