---
title: "[Android]获取其他应用的logcat"
author: "MyEyeOfJava"
date: "2013-11-19T13:52:13Z"
tags: []
categories: ["操作系统"]
slug: "android-logcat"
draft: false
lastmod: "2013-11-18T16:36:15Z"
id: 1976540
url: "https://myeyeofjava.iteye.com/blog/1976540"
---

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