Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using LogCat on JellyBean

I have a bug that happens very randomly, so I rely on a LogCat monitoring app I bought off the Play Store, to see the exceptions thrown on my device when it happens. Since using Jelly Bean, I'm seeing no logging. I've read that, with Jelly Bean, an app can only see the LogCat output of itself.

So outside of rooting my device, is there any way to read the LogCat output of my app on my phone directly? I know I can use Eclipse, but, like I said, it happens so randomly and I can't manually recreate it.

like image 597
Kris B Avatar asked Sep 13 '12 13:09

Kris B


2 Answers

So outside of rooting my device, is there any way to read the LogCat output of my app on my phone directly?

Not really. You can read discussions on aLogcat bugtracker about this issue:

After doing some reading and some testing, I've found three ways to make aLogcat work, all of which use root.

More detailed discussion about READ_LOGS permission is not granted to 3rd party applications in Jelly Bean (api 16)

like image 145
HitOdessit Avatar answered Nov 15 '22 00:11

HitOdessit


What do you think about writing directly to the screen using a textView? Of course this would only be for a debug build.

This post contains code that prints logcat errors on the screen Write android logcat data to a file

Now all that's left to do is to put try/catch stmts in your code, where the try surrounds code you think is problematic. The catch delegates to writing the error message to your screen.

like image 41
sudocoder Avatar answered Nov 15 '22 00:11

sudocoder