Local Tech Repair: Parsing Your Alogcat on Android terminal emulator

Wednesday, June 19, 2013

Parsing Your Alogcat on Android terminal emulator

When running alogcat you will be getting lots of logs that you do not need and it is important to filter out the junk.

The easiest way to filter the log is to use grep to get the important information out. I tend to like to use process IDs as my filtering too.

Here is an example of what it may look like

W/MmsSender( 4098): Sending MMS SendItem...
W/PduComposer( 4098): Making send request...
W/PduComposer( 4098): Making message body...
W/PduComposer( 4098): Returning: 69860 bytes...
W/MmsSender( 4098): Sending MMS of length: 69860
E/DatabaseUtils( 1037): Writing exception to parcel
E/DatabaseUtils( 1037): at dalvik.system.NativeStart.run(Native Method)
W/MmsCommunication( 4098): java.lang.SecurityException: No permission to write APN settings: Neither user 10081 nor current process has android.permission.WRITE_APN_SETTINGS.
What we want to do is filter out the important stuff with grep. You can save your alogcat  chat will be saved at /sdcard/alogcat/alogcat*  this is what we need to grep and filter out in terminal.

When we open terminal we will want to grep -i -e 4098 -e 1037 /sdcard/alogcat/alogcat* > test.txt

This will save a test.txt file with the output of process IDs 4098 and 1037. We have to do it this way since egrep is not available in android terminal emulator.

You will first need to know what your process IDs are before this grep will work and you can filter out which ever ones you need.

I hope this helps those that are trying to debug or send debug reports in to developers.

Thanks for reading,
-Local Tech Repair Admin

No comments:

Post a Comment