[Android]获取其他应用的logcat
android 系统 4.1+,对logcat的读取做了限制。 在设备中,使用
Runtime.getRuntime().exec("logcat"); 无法拿到其它进程的logcat。
以下是解决方案,但是需要root权限。
添加某一应用的权限: pm grant org.jtb.alogcat.donate android.permission.READ_LOGS
添加所有应用的权限: chmod 04755 /system/bin/logcat
摘自: http://android.stackexchange.com/questions/28857/how-can-i-access-android-log-files-on-my-nexus-7-without-root-access