Rosenpin Rosenpin - 1 year ago 109
Android Question

How to get logs of other apps?

I want to read logs from other apps and filter them so when a certain keyword is being logged, my application will perform a certain task.

I found several methods of reading logs, but from my testing I could only get my application logs.

This is the method I originally tried to use

try {
Process process = Runtime.getRuntime().exec("logcat -d");
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(process.getInputStream()));

StringBuilder log=new StringBuilder();
String line = "";
while ((line = bufferedReader.readLine()) != null) {
TextView tv = (TextView)findViewById(;
catch (IOException e) {}

But it seems like it only reads the logs of my app.

Answer Source

You can only read the logs of all apps if the device is rooted.

If you want to read logs of rooted devices, then this should help you. However, you will have to set the targetSdk to 16.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download