By Mark Booth


2012-09-06 10:21:11 8 Comments

Since aLogcat now no longer works with Jelly Bean, how can I access the system log files on my device without either root access or attaching it to a computer?

I have tried using adb logcat from my PC and that worked fine, so I know that plenty of messages are being logged.

Using logcat from Android Terminal Emulator on my Nexus 7 shows almost no output though and adb logcat from Android Terminal Emulator, starts the daemon but then just says - waiting for device - and nothing more appears.

So, is it possible to access android log files on my Nexus 7 without root access?

3 comments

@Anton Tananaev 2016-07-05 23:55:56

I have developed a Logcat app that uses alternative approach. It utilizes remote debugging feature. You need to enable it on the phone first, but it has to be done only once and then you can use the app to retrieve all logs.

@ce4 2012-09-06 12:27:47

No, for security reasons it is not possible to access android log files on the Nexus 7 (or any other device running Jelly Bean or higher) without root access. Google changed that with Jelly Bean.

I'd suggest you wait until logcat readers like aLogCat and such get fixed (i.e. they will require root access to show all logs then).

From AISEC-TR-2012-001-Android-OS-Security.pdf - 3.3 Android Permission Model:

The READ_LOGS permission can substitute the following on many devices, depending on the Android version and thus the standard apps’ versions installed:

  • READ_CONTACTS

  • GET_TASKS – every started Activity is listed in the system’s logs

  • READ_HISTORY_BOOKMARKS – opening new web pages is a browser Activity and thus logged

  • READ_SMS

All solutions below require root access:

You need to either run logcat as root in a shell or manually grant it via the shell pm command (root required) works also (see XDA, exchange org.jtb.alogcat.donate with the app's pkg name):

pm grant org.jtb.alogcat.donate android.permission.READ_LOGS

This is for the lazy ones and not suggested: If you're desperate, careless and lazy, you can fix it by giving every app the READ_LOGS permission by applying this ugly and insecure hack (Chainfire via twitter):

chmod 04755 /system/bin/logcat

To quote CyanogenMod developer Koushik Dutta's G+ post:

Did the Android Log permissions/behavior change in JellyBean?

It seems that if an application runs "logcat" now, it can see only the log entries created by its UID. Log lines from other UIDs are not shown. Basically, it seems to be filtered now.

I have the same permissions as usual. Also confirmed the same thing is happening in other log collector apps.

@ce4 2012-09-06 13:12:14

There's no way without root of which I know of. For the sake of security. Starting with JellyBean, the read_logs permission doesn't have to be granted anymore (each app can only view it's own logs anyway).

@ce4 2012-09-06 14:16:27

Thanks for the edit and the link to xda, I integrated that.

@Mark Booth 2012-09-09 01:55:35

Thanks for adding in the pm grant option. Note that as I now say in my other answer, you need to specify a slightly different package if you aren't using the donate version of aLogcat: pm grant org.jtb.alogcat android.permission.READ_LOGS

@Flow 2013-10-24 23:25:42

The referenced paper does to explain how READ_LOGS is equal to READ_CONTACTS on some platforms. I guess the mean that some apps put contact data in the logs, but that's not really the same as READ_CONTACTS. But then I'd say that the paper is written in a alarmist tone.

@ce4 2013-10-25 06:53:27

READ_LOGS leaks a lot more information than just contact data. There's the user's name, probably gmail address, locations, installed apps (app usage even) and so on. Plus: it has been used to read and extract addresses from stack dumps of system daemons in the pre ASLR days by root exploits. Now that they're switched off on a big part (4.1±) you may get swarm protection (compare it to not vaccinating your child in a disease free vaccinated population). Problems loomed and Google did the right thing.

@Russ Wheeler 2012-09-18 23:42:09

I'm confused by this though it would explain some things.

Running the same app on my nexus7 and my galaxy nexus, both on jellybean, the phone sees log output from all apps, the tablet doesn't. This would say that it's not jellybean its the nexus7. Backing this up, I've just checked and they both have different kernels. The tablet, with a newer one.

Maybe its the updated kernel that, means logs don't appear.

Guess I'll have to root after all: (

@Mark Booth 2012-09-19 09:45:57

That's interesting Russ, thanks for the extra information.

@Russ Wheeler 2012-09-22 20:23:02

Actually I've now been reliably informed that its because the app I am using to see the logs, was installed on my machine when I had ICS so it's retained the permissions to see the logs.

Related Questions

Sponsored Content

2 Answered Questions

[SOLVED] What is the format of Android's logs?

  • 2012-10-01 15:54:13
  • Scott Severance
  • 12331 View
  • 8 Score
  • 2 Answer
  • Tags:   logging

2 Answered Questions

Root Nexus 7 with 4.2.2

  • 2013-08-28 19:15:17
  • numberwang
  • 578 View
  • 0 Score
  • 2 Answer
  • Tags:   rooting nexus-7

2 Answered Questions

1 Answered Questions

[SOLVED] How active should I expect my Jelly Bean system log file to be?

2 Answered Questions

[SOLVED] Problems accessing message logs on Jelly Bean with aLogcat

3 Answered Questions

[SOLVED] Can the on-board ADB Server find the device itself?

1 Answered Questions

Sponsored Content