• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[UNIVERSAL][LOGCAT]How to get & read a logcat/ Troubleshoot your own issues!

What are you using this guide for?


  • Total voters
    937
Search This thread

Stryke_the_Orc

Retired Senior Moderator
Oct 14, 2010
6,779
8,997
Maras Dantia



DUE TO REAL LIFE TIME CONSTRAINTS I AM UNABLE TO CONTINUE READING AND DIAGNOSING LOGS FOR MEMBERS. PLEASE USE THIS THREAD AS INTENDED, AS A STARTING POINT IN LEARNING TO READ THESE LOGS AND DIAGNOSE PROBLEMS YOURSELF. THANK YOU!




The Basics

I'm starting this thread in hopes of sharing some very useful information to all our new members and hopefully either teaching something new or being a good refresher for our experienced members. I've been asked before how to tell what errors are present in logcats, how I can understand all that mess, etc...

Well, I'm going to try my best to explain all of it. In this way, you can get your own logs and try to fix the problems, or know exactly what is causing your problems to help out the developers so they aren't looking through thousands of lines of code for each persons issue.

Help us help you!

ATTENTION:
Due to the recent feature in the portal, my thread has become increasingly popular, and as such I am getting a lot of requests for help. You may post your logs here, but please do so in either pastebin format, or use hide tags. Please DO NOT request help via pm. This is for a couple of reasons:
  1. I can't keep up with all the requests.
  2. Your logs may be solved by another member, I have requested that any willing RC's, RD's, Moderators, or members willing to help, to do so.
  3. If you post your logs here, any member may look at it and help you solve them.
Thank you.


To begin with, we'll need to have some understanding of adb. Check out this thread by @bigtoysrock and be sure to thank him!

Logcats

First, we'll need to know how to get a logcat. With the plethora of new users this has been the subject of many, many discussions. When asked to get a logcat, they don't know how.


Tools and Requirements

First of all, you'll absolutely NEED to have usb debugging enabled. To do this go to SETTINGS, navigate down to DEVELOPER OPTIONS and select it, if they are not on use the toggle in the top right corner and select USB DEBUGGING ( See attached screen shots )

Secondly, you'll absolutely NEED to have the ANDROID SDK grab it here
Install the SDK on the root of your computer. DO NOT change the SDK name to include any spaces as it will fail!

Also be sure to grab your device specific drivers, if they aren't already installed. Some devices will install them automatically, while others require a simple google search.

Now that you've got everything you need, lets grab a logcat!

Update: 15 Second ADB installer for windows is an excellent alternative for the above instructions, and while you're there be sure to thank @Snoop05

How to get a Logcat

Windows
Navigate to where you've installed the sdk. Once you've gotten into the sdk, you're going to look for "PLATFORM TOOLS" folder, inside hold shift + right click on any empty space, select "OPEN COMMAND WINDOW HERE"
Connect your phone to your PC via usb cable, in the command window type "adb devices" without the quotes. If you've set everything up properly it should return an alpha-numeric value, this is your device ID. If not, you've missed a step or installed sdk in the wrong manner. Go back and double check your steps.

Now that we know you're connected there are a few options, you can run the logcat in command window, or you can export it to a .txt file.

To see the log in command window just type "adb logcat" (again no quotes) and the log will scroll through your screen. To stop scrolling so you can investigate hit ctrl + c

To export to a .txt file (I personally prefer this method) type "adb logcat > logcat.txt". You can name the logcat anything you want, for example "adb logcat > MyError.txt" just be sure not to include spaces or special characters in the name of the file.



MAC/Linux

"Instructions:

Install your device driver for using adb. Everything you need will you find here
Download adb executable for your OS (Download: Windows | Linux | Mac). Paste it somewhere.
Connect your android device.
Verify if "Settings > Developer options > USB debugging" is checked, if not, simply check it.
Open a command promt (windows) or terminal (linux / mac). How to do it: On Windows: windows + r > enter "cmd" (without quotes) > click enter | On Linux: You don't know how to open a terminal? LOL | On Mac: Type Terminal into Spotlight and open it
CD to the directory where the adb executable is located. On Windows: Go to the directory where you downloaded the adb executable, Shift+Right Click and select "Open Console" (or similar) | On Linux / Mac: Rightclick in the directory and select "Open Terminal here" (or simply CD into the directory)
Type in your cmd/terminal: adb devices to verify your device is properly connected.
If your device is properly selected, type in adb logcat to show the mighty and magic logcat aka stacktrace.
Reproduce your error (or whatever) on your device.
Right after, paste the whole cmd / terminal window into a paste-service like http://pastebin.com/ and send it to us." - Quoted from Leandros here
 

Attachments

  • Screenshot_2013-05-11-09-45-34.jpg
    Screenshot_2013-05-11-09-45-34.jpg
    23.8 KB · Views: 25,110
  • Screenshot_2013-05-11-09-45-45.jpg
    Screenshot_2013-05-11-09-45-45.jpg
    36.6 KB · Views: 21,790
Last edited:

Stryke_the_Orc

Retired Senior Moderator
Oct 14, 2010
6,779
8,997
Maras Dantia
Reading and understanding logcat output

Reading a Logcat

Ok, so now we have our log but what do we do with it?
There are a few things that you need to know before you'll understand what is what.
Preceding every line in a logcat is a class, you can learn about them here.
These will look like this and I have placed the meaning next to each:
Code:
E/       Error - I would hope this is self explanatory
F/       Fatal Error - Again pretty self explanatory
I/        Information - This is pretty tricky, the information class shows what the system is doing, but it can also show you errors so read it carefully!
D/      Dalvikvm - This class will show what the dalvik processes are doing, but can also show you where mistakes are
W/     Warning - Warnings are basically errors, but less severe. Usually it will show you missing resources, conflicting or missing paths, etc...
V/      Verbose - Basically everything the phone is doing
S/      Silent - You will not see silent


Ok so lets see some examples. Some of these will be more in-depth than others simply because there is more to it.

Code:
[COLOR="Red"]D/dalvikvm( 1853): DexOpt: --- BEGIN 'core.jar' (bootstrap=1) ---[/COLOR]
Here we see that the dalvik process has begun to optimize our system files.

[COLOR="red"]D/dalvikvm( 2162): DexOpt: 'Lcom/sec/android/seccamera/SecCamera$OnMultiFrameShotEventListener;' has an earlier definition; blocking out[/COLOR]
Here you can see that the Dalvik process has already defined the called method, and is skipping the optimization

[COLOR="red"]I/PackageManager( 2130): /system/app/sCloudSyncBrowser.apk changed; collecting certs[/COLOR]
The information class is showing that there has been a change made to this apk, and is verifying the signature.

[COLOR="red"]W/ResourceType( 2130): Failure getting entry for 0x7f050020 (t=4 e=32) in package 0 (error -75)

D/PhoneStatusBar( 2792): Added status bar view

D/PhoneStatusBar( 2792): disable: < expand icons alerts ticker system_info back home recent clock >

W/PackageManager( 2130): Failure retrieving xml 0x7f050020 in package com.maxmpz.audioplayer

W/PackageManager( 2130): android.content.res.Resources$NotFoundException: Resource ID #0x7f050020

W/PackageManager( 2130): at android.content.res.Resources.getValue(Resources.java:1339)

W/PackageManager( 2130): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2445)

W/PackageManager( 2130): at android.content.res.Resources.getXml(Resources.java:1227)

W/PackageManager( 2130): at android.app.ApplicationPackageManager.getXml(ApplicationPackageManager.java:1080)

W/PackageManager( 2130): at android.content.pm.PackageItemInfo.loadXmlMetaData(PackageItemInfo.java:227)

W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.parseProviderInfoXml(AppWidgetServiceImpl.java:1264)

W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.addProviderLocked(AppWidgetServiceImpl.java:1162)

W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.loadAppWidgetList(AppWidgetServiceImpl.java:1148)

W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.ensureStateLoadedLocked(AppWidgetServiceImpl.java:391)

W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.systemReady(AppWidgetServiceImpl.java:211)

W/PackageManager( 2130): at com.android.server.AppWidgetService.systemReady(AppWidgetService.java:156)

W/PackageManager( 2130): at com.android.server.ServerThread$1.run(SystemServer.java:1882)

W/PackageManager( 2130): at com.android.server.am.ActivityManagerService.systemReady(ActivityManagerService.java:8250)

W/PackageManager( 2130): at com.android.server.am.ActivityManagerService$9$1.run(ActivityManagerService.java:8152)

W/PackageManager( 2130): at android.os.Handler.handleCallback(Handler.java:615)

W/PackageManager( 2130): at android.os.Handler.dispatchMessage(Handler.java:92)

W/PackageManager( 2130): at android.os.Looper.loop(Looper.java:137)

W/PackageManager( 2130): at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1563)

W/ResourceType( 2130): Failure getting entry for 0x7f050021 (t=4 e=33) in package 0 (error -75)

W/PackageManager( 2130): Failure retrieving xml 0x7f050021 in package com.maxmpz.audioplayer

W/PackageManager( 2130): android.content.res.Resources$NotFoundException: Resource ID #0x7f050021

W/PackageManager( 2130): at android.content.res.Resources.getValue(Resources.java:1339)

W/PackageManager( 2130): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2445)

W/PackageManager( 2130): at android.content.res.Resources.getXml(Resources.java:1227)

W/PackageManager( 2130): at android.app.ApplicationPackageManager.getXml(ApplicationPackageManager.java:1080)

W/PackageManager( 2130): at android.content.pm.PackageItemInfo.loadXmlMetaData(PackageItemInfo.java:227)

W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.parseProviderInfoXml(AppWidgetServiceImpl.java:1264)

W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.addProviderLocked(AppWidgetServiceImpl.java:1162)

W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.loadAppWidgetList(AppWidgetServiceImpl.java:1148)

W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.ensureStateLoadedLocked(AppWidgetServiceImpl.java:391)

W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.systemReady(AppWidgetServiceImpl.java:211)

W/PackageManager( 2130): at com.android.server.AppWidgetService.systemReady(AppWidgetService.java:156)

W/PackageManager( 2130): at com.android.server.ServerThread$1.run(SystemServer.java:1882)

W/PackageManager( 2130): at com.android.server.am.ActivityManagerService.systemReady(ActivityManagerService.java:8250)

W/PackageManager( 2130): at com.android.server.am.ActivityManagerService$9$1.run(ActivityManagerService.java:8152)

W/PackageManager( 2130): at android.os.Handler.handleCallback(Handler.java:615)

W/PackageManager( 2130): at android.os.Handler.dispatchMessage(Handler.java:92)

W/PackageManager( 2130): at android.os.Looper.loop(Looper.java:137)

W/PackageManager( 2130): at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1563)[/COLOR]
Here is a great example of the warning class showing missing resources.

[COLOR="red"]I/dalvikvm( 1853): Could not find method android.app.IActivityManager.resizeArrangedWindow, referenced from method android.app.ActivityManager.resizeArrangedWindow

W/dalvikvm( 1853): VFY: unable to resolve interface method 3769: Landroid/app/IActivityManager;.resizeArrangedWindow (IILandroid/graphics/Rect;)Landroid/graphics/Rect;

D/dalvikvm( 1853): VFY: replacing opcode 0x72 at 0x0004[/COLOR]
A prime example of Information class showing an "error", these will usually be listed in information class if they don't have a great impact of the functionality of the device.

[COLOR="red"]F/PackageManager( 2014): Unable to backup package manager settings,  current changes will be lost at reboot
E/DropBoxManagerService(2014):  Can't write: system_server_wtf
E/DropBoxManagerService(2014):  java.io.FileNotFoundException: /data/system/dropbox/drop21.tmp: open failed: EROFS (Read-only file system)
E/DropBoxManagerService(2014):  at libcore.io.IoBridge.open(IoBridge.java:416)
E/DropBoxManagerService(2014):  at java.io.FileOutputStream.(FileOutputStream.java:88)
E/DropBoxManagerService(2014):  at java.io.FileOutputStream.(FileOutputStream.java:73)
E/DropBoxManagerService(2014):  at com.android.server.DropBoxManagerService.add(DropBoxManagerService.java:208)
E/DropBoxManagerService(2014):  at android.os.DropBoxManager.addText(DropBoxManager.java:272)
E/DropBoxManagerService(2014):  at com.android.server.am.ActivityManagerService$13.run(ActivityManagerService.java:8281)
E/DropBoxManagerService(2014):  at com.android.server.am.ActivityManagerService.addErrorToDropBox(ActivityManagerService.java:8288)
E/DropBoxManagerService(2014):  at com.android.server.am.ActivityManagerService.handleApplicationWtf(ActivityManagerService.java:8099)
E/DropBoxManagerService(2014):  at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:329)
E/DropBoxManagerService(2014):  at android.util.Log$1.onTerribleFailure(Log.java:103)
E/DropBoxManagerService(2014):  at android.util.Log.wtf(Log.java:278)
E/DropBoxManagerService(2014):  at android.util.Log.wtf(Log.java:255)
E/DropBoxManagerService(2014):  at com.android.server.pm.Settings.writeLPr(Settings.java:1115)
E/DropBoxManagerService(2014):  at com.android.server.pm.PackageManagerService.unloadMediaPackages(PackageManagerService.java:9314)
E/DropBoxManagerService(2014):  at com.android.server.pm.PackageManagerService.updateExternalMediaStatusInner(PackageManagerService.java:9128)
E/DropBoxManagerService(2014):  at com.android.server.pm.PackageManagerService.access$3800(PackageManagerService.java:165)
E/DropBoxManagerService(2014):  at com.android.server.pm.PackageManagerService$10.run(PackageManagerService.java:9017)
E/DropBoxManagerService(2014):  at android.os.Handler.handleCallback(Handler.java:615)
E/DropBoxManagerService(2014):  at android.os.Handler.dispatchMessage(Handler.java:92)
E/DropBoxManagerService(2014):  at android.os.Looper.loop(Looper.java:137)
E/DropBoxManagerService(2014):  at android.os.HandlerThread.run(HandlerThread.java:60)
E/DropBoxManagerService(2014):  Caused by: libcore.io.ErrnoException: open failed: EROFS (Read-only file system)
E/DropBoxManagerService(2014):  at libcore.io.Posix.open(Native Method)
E/DropBoxManagerService(2014):  at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
E/DropBoxManagerService(2014):  at libcore.io.IoBridge.open(IoBridge.java:400)
E/DropBoxManagerService(2014):  ... 20 more[/COLOR]
Here we have the Fatal and Error classes.

Ok, so now we have seen some examples, lets learn to decipher them:highfive:

The beautiful thing about these logs is that they tell you exactly what and where everything is, as long as you know what you're looking at.
I'm only going to use the one line to show you how to read a log, as the format is exactly the same for any class.
Code:
E/DropBoxManagerService(2014):  at com.android.server.am.ActivityManagerService.addErrorToDropBox(ActivityManagerService.java:8288)

So here we have the printed error from logcat, the format used is as follows
Class/Process/Location
[b]Important! The log WILL NOT tell you what apk or jar the error occurs in, this is the hardest part of debugging![/b]

In the above error we see
Class = E/
Process = DropBoxManagerService
Location = com.android.server.am.ActivityManagerService.addErrorToDropBox(ActivityManagerService.java:8288) (Folder directory.File Name. Method)

I know from all my digging that the specified path is in services.jar so once I have services.jar decompiled I'll follow the path laid out. (Decompile "apkname".odex for odexed roms and classes.dex for deodexed roms)
These paths will always be located in the smali folder! For example I open my classes.dex folder after decompiling and see a smali folder, I'll open that and then I have options. The . after every word is a folder directory ( same as / in your computer directory )
The specified path says com. so I'll open the com folder, next I'm directed to android, then server, then am folder.
Now I should see a bunch of files and possibly some folders, [b]if there is no folder name that matches the next directory it is a file![/b]
ActivityManagerService is a filename, so I'll open that file using NotePad++ and search for the specified method which is addErrorToDropBox.
From here I can use another file to compare the lines to find my error, or I can know exactly where the error occured and report my problem to a helpful dev or member.

I hope that this has been a good learning experience and will help you to understand any issues you are facing.
:victory:
 
Last edited:

Stryke_the_Orc

Retired Senior Moderator
Oct 14, 2010
6,779
8,997
Maras Dantia
Bootloops and Filtering your logs

Getting a Logcat during the dreaded Bootloop

The only difference between grabbing a logcat while running and grabbing one during a bootloop is the program you're going to use. Instead of the standard adb bridge, we'll be using the adb monitor tool. You can find this tool under the "TOOLS" folder. Open the "Tools" folder, right click on any empty space and select "Open Command Window Here"
Once the window is open, type "monitor" (without the quotes) and press enter. A whole new program will open listing the device ID and subfolders (your devices partitions)
IMPORTANT! The device ID may not show up right away, THIS IS OK! I found that it took about three bootloop cycles to actually connect.
Once you see the device ID, within a few seconds you should see the "system" partition listed underneath. Select it.
Down in the bottom left corner select the "Logcat" tab. From here, you can grab the logcat in a txt format or just watch it scroll.
I have taken screenshots of the process, and are available here

There's a great guide here that goes a little more in depth and has updated information about the requirements for a log during bootloops.


How to Filter your Logcat

Lets say you want to find only the logs for a specific app or process, searching through thousands of lines can be a pain. Luckily, adb allows you to filter your logs based on application tags!
Here's how:
Code:
adb logcat ActivityManager:I MyApp:D *:S

This filter basically says "Show me only logs for ActivityManager at an Information or above level, and all logs for 'MyApp' with a priority level of Debug and higher" The *:S is important here, this makes all other tags Silent so that it ensures only the filtered tags are shown in your log.How's that for handy?


Demesg (kernel) Logs

For a demesg log you'll want to follow the same instructions as above to get into adb terminal.
Once there, type adb devices to verify you're connected. Now you can pull a log by simply typing "adb shell dmesg > dmesg.txt" (without the quotatons" This will place the logs in the same folder that you launched terminal from (platform-tools)

Also, for more detailed information and a few other useful commands check out this site
 
Last edited:

Stryke_the_Orc

Retired Senior Moderator
Oct 14, 2010
6,779
8,997
Maras Dantia
Apps and Reference

Apps for grabbing Logcats


Mobile Apps

alogcat

This app is great for seeing your logs, especially on older Android versions. The biggest issue I have with this app is that the share function doesn't work properly on jellybean. Yet...
You can grab it here

CatLog

I personally have no experience with this app, but it's highly rated in Play Store and has an easy to use User Interface.
Grab it here

getlogs

This is my favorite of these apps, I can use it to grab almost any log I want. Highly recommended for any developer, themer, or enthusiast!
Simple, clean, effective. The way getting your logs should be:D
Grab it here

Logcat Reader

Grab it here

Logcat Extreme

This one looks pretty cool, it has a "floating logcat" feature. Grab it here


PC Applications

A pretty neat logcat tool is AIOlog found here, contains versions for Windows, Linux and MacOS's by 32 and 64 bit systems.


Here's a neat tool for you windows users, an AIO Logcat manager. Grab it, and view the orignal thread here

Another for you windows users, Easy Logcat Maker is an executable GUI that looks pretty neat.

Another cool logging tool is here created by the genius behind VTS!

A new Windows tool by @FuzzyMeep Two, the aptly named Logcat Tool will parse your logcat to show you how many of each entry your logs contain, and then it organizes your logs into separate files based on the type of entry (Warning, Error, Verbose, etc...), and more! This could easily become my favorite desktop method of grabbing logs.
Misc. Apps and Tools

For those of you using linux there is a neat tool that color codes your logcat output to make it easier to read. You can find it here

Not a logcat app, per se, but a pretty entertaining and live logcat boot animation courtesy of @Chainfire can be found here. Download it and see your device boot in real time!


There are a lot more apps available than what I've covered here. These are simply the most widely known (possibly with the exception of getlogs) and widely used/recommended. If you find or make any more of these apps, please feel free to post the link here and share with the community!

PLEASE NOTE THAT IT IS AGAINST XDA RULES TO LINK TO PAID APPS, SO DO NOT LINK TO PAID SERVICES OR THE POST WILL BE REPORTED AND LIKELY REMOVED

Reference Links:
Googles Logcat Help Pages
How to get useful logs by tonyp
Guide to logcats provided by Deadly
Color Coding Your Logcat World


Please be sure to thank the developers of these fantastic tools for their time and efforts!
 
Last edited:

Deadly

Senior Member
Jul 19, 2012
10,286
3,899
Bangalore
@ stryke_the_orc. Great job.. will add this to useful thread links in my guide..

Btw.. you have code tags inside hide.. so it doesn't appear hidden in app.. try putting code outside of hide or something.. usually indent or code tags inside hide makes hide not to work on app..

______________________________________
Anyone who doesn't think there are two sides to an argument is probably in one.
 

Stryke_the_Orc

Retired Senior Moderator
Oct 14, 2010
6,779
8,997
Maras Dantia
@ stryke_the_orc. Great job.. will add this to useful thread links in my guide..

Btw.. you have code tags inside hide.. so it doesn't appear hidden in app.. try putting code outside of hide or something.. usually indent or code tags inside hide makes hide not to work on app..

______________________________________
Anyone who doesn't think there are two sides to an argument is probably in one.

Thanks, I couldn't figure out why the tags didn't work on app :)

Slithering from the nether regions of a twisted mind and tarnished soul
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 243



    DUE TO REAL LIFE TIME CONSTRAINTS I AM UNABLE TO CONTINUE READING AND DIAGNOSING LOGS FOR MEMBERS. PLEASE USE THIS THREAD AS INTENDED, AS A STARTING POINT IN LEARNING TO READ THESE LOGS AND DIAGNOSE PROBLEMS YOURSELF. THANK YOU!




    The Basics

    I'm starting this thread in hopes of sharing some very useful information to all our new members and hopefully either teaching something new or being a good refresher for our experienced members. I've been asked before how to tell what errors are present in logcats, how I can understand all that mess, etc...

    Well, I'm going to try my best to explain all of it. In this way, you can get your own logs and try to fix the problems, or know exactly what is causing your problems to help out the developers so they aren't looking through thousands of lines of code for each persons issue.

    Help us help you!

    ATTENTION:
    Due to the recent feature in the portal, my thread has become increasingly popular, and as such I am getting a lot of requests for help. You may post your logs here, but please do so in either pastebin format, or use hide tags. Please DO NOT request help via pm. This is for a couple of reasons:
    1. I can't keep up with all the requests.
    2. Your logs may be solved by another member, I have requested that any willing RC's, RD's, Moderators, or members willing to help, to do so.
    3. If you post your logs here, any member may look at it and help you solve them.
    Thank you.


    To begin with, we'll need to have some understanding of adb. Check out this thread by @bigtoysrock and be sure to thank him!

    Logcats

    First, we'll need to know how to get a logcat. With the plethora of new users this has been the subject of many, many discussions. When asked to get a logcat, they don't know how.


    Tools and Requirements

    First of all, you'll absolutely NEED to have usb debugging enabled. To do this go to SETTINGS, navigate down to DEVELOPER OPTIONS and select it, if they are not on use the toggle in the top right corner and select USB DEBUGGING ( See attached screen shots )

    Secondly, you'll absolutely NEED to have the ANDROID SDK grab it here
    Install the SDK on the root of your computer. DO NOT change the SDK name to include any spaces as it will fail!

    Also be sure to grab your device specific drivers, if they aren't already installed. Some devices will install them automatically, while others require a simple google search.

    Now that you've got everything you need, lets grab a logcat!

    Update: 15 Second ADB installer for windows is an excellent alternative for the above instructions, and while you're there be sure to thank @Snoop05

    How to get a Logcat

    Windows
    Navigate to where you've installed the sdk. Once you've gotten into the sdk, you're going to look for "PLATFORM TOOLS" folder, inside hold shift + right click on any empty space, select "OPEN COMMAND WINDOW HERE"
    Connect your phone to your PC via usb cable, in the command window type "adb devices" without the quotes. If you've set everything up properly it should return an alpha-numeric value, this is your device ID. If not, you've missed a step or installed sdk in the wrong manner. Go back and double check your steps.

    Now that we know you're connected there are a few options, you can run the logcat in command window, or you can export it to a .txt file.

    To see the log in command window just type "adb logcat" (again no quotes) and the log will scroll through your screen. To stop scrolling so you can investigate hit ctrl + c

    To export to a .txt file (I personally prefer this method) type "adb logcat > logcat.txt". You can name the logcat anything you want, for example "adb logcat > MyError.txt" just be sure not to include spaces or special characters in the name of the file.



    MAC/Linux

    "Instructions:

    Install your device driver for using adb. Everything you need will you find here
    Download adb executable for your OS (Download: Windows | Linux | Mac). Paste it somewhere.
    Connect your android device.
    Verify if "Settings > Developer options > USB debugging" is checked, if not, simply check it.
    Open a command promt (windows) or terminal (linux / mac). How to do it: On Windows: windows + r > enter "cmd" (without quotes) > click enter | On Linux: You don't know how to open a terminal? LOL | On Mac: Type Terminal into Spotlight and open it
    CD to the directory where the adb executable is located. On Windows: Go to the directory where you downloaded the adb executable, Shift+Right Click and select "Open Console" (or similar) | On Linux / Mac: Rightclick in the directory and select "Open Terminal here" (or simply CD into the directory)
    Type in your cmd/terminal: adb devices to verify your device is properly connected.
    If your device is properly selected, type in adb logcat to show the mighty and magic logcat aka stacktrace.
    Reproduce your error (or whatever) on your device.
    Right after, paste the whole cmd / terminal window into a paste-service like http://pastebin.com/ and send it to us." - Quoted from Leandros here
    92
    Reading and understanding logcat output

    Reading a Logcat

    Ok, so now we have our log but what do we do with it?
    There are a few things that you need to know before you'll understand what is what.
    Preceding every line in a logcat is a class, you can learn about them here.
    These will look like this and I have placed the meaning next to each:
    Code:
    E/       Error - I would hope this is self explanatory
    F/       Fatal Error - Again pretty self explanatory
    I/        Information - This is pretty tricky, the information class shows what the system is doing, but it can also show you errors so read it carefully!
    D/      Dalvikvm - This class will show what the dalvik processes are doing, but can also show you where mistakes are
    W/     Warning - Warnings are basically errors, but less severe. Usually it will show you missing resources, conflicting or missing paths, etc...
    V/      Verbose - Basically everything the phone is doing
    S/      Silent - You will not see silent


    Ok so lets see some examples. Some of these will be more in-depth than others simply because there is more to it.

    Code:
    [COLOR="Red"]D/dalvikvm( 1853): DexOpt: --- BEGIN 'core.jar' (bootstrap=1) ---[/COLOR]
    Here we see that the dalvik process has begun to optimize our system files.
    
    [COLOR="red"]D/dalvikvm( 2162): DexOpt: 'Lcom/sec/android/seccamera/SecCamera$OnMultiFrameShotEventListener;' has an earlier definition; blocking out[/COLOR]
    Here you can see that the Dalvik process has already defined the called method, and is skipping the optimization
    
    [COLOR="red"]I/PackageManager( 2130): /system/app/sCloudSyncBrowser.apk changed; collecting certs[/COLOR]
    The information class is showing that there has been a change made to this apk, and is verifying the signature.
    
    [COLOR="red"]W/ResourceType( 2130): Failure getting entry for 0x7f050020 (t=4 e=32) in package 0 (error -75)
    
    D/PhoneStatusBar( 2792): Added status bar view
    
    D/PhoneStatusBar( 2792): disable: < expand icons alerts ticker system_info back home recent clock >
    
    W/PackageManager( 2130): Failure retrieving xml 0x7f050020 in package com.maxmpz.audioplayer
    
    W/PackageManager( 2130): android.content.res.Resources$NotFoundException: Resource ID #0x7f050020
    
    W/PackageManager( 2130): at android.content.res.Resources.getValue(Resources.java:1339)
    
    W/PackageManager( 2130): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2445)
    
    W/PackageManager( 2130): at android.content.res.Resources.getXml(Resources.java:1227)
    
    W/PackageManager( 2130): at android.app.ApplicationPackageManager.getXml(ApplicationPackageManager.java:1080)
    
    W/PackageManager( 2130): at android.content.pm.PackageItemInfo.loadXmlMetaData(PackageItemInfo.java:227)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.parseProviderInfoXml(AppWidgetServiceImpl.java:1264)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.addProviderLocked(AppWidgetServiceImpl.java:1162)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.loadAppWidgetList(AppWidgetServiceImpl.java:1148)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.ensureStateLoadedLocked(AppWidgetServiceImpl.java:391)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.systemReady(AppWidgetServiceImpl.java:211)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetService.systemReady(AppWidgetService.java:156)
    
    W/PackageManager( 2130): at com.android.server.ServerThread$1.run(SystemServer.java:1882)
    
    W/PackageManager( 2130): at com.android.server.am.ActivityManagerService.systemReady(ActivityManagerService.java:8250)
    
    W/PackageManager( 2130): at com.android.server.am.ActivityManagerService$9$1.run(ActivityManagerService.java:8152)
    
    W/PackageManager( 2130): at android.os.Handler.handleCallback(Handler.java:615)
    
    W/PackageManager( 2130): at android.os.Handler.dispatchMessage(Handler.java:92)
    
    W/PackageManager( 2130): at android.os.Looper.loop(Looper.java:137)
    
    W/PackageManager( 2130): at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1563)
    
    W/ResourceType( 2130): Failure getting entry for 0x7f050021 (t=4 e=33) in package 0 (error -75)
    
    W/PackageManager( 2130): Failure retrieving xml 0x7f050021 in package com.maxmpz.audioplayer
    
    W/PackageManager( 2130): android.content.res.Resources$NotFoundException: Resource ID #0x7f050021
    
    W/PackageManager( 2130): at android.content.res.Resources.getValue(Resources.java:1339)
    
    W/PackageManager( 2130): at android.content.res.Resources.loadXmlResourceParser(Resources.java:2445)
    
    W/PackageManager( 2130): at android.content.res.Resources.getXml(Resources.java:1227)
    
    W/PackageManager( 2130): at android.app.ApplicationPackageManager.getXml(ApplicationPackageManager.java:1080)
    
    W/PackageManager( 2130): at android.content.pm.PackageItemInfo.loadXmlMetaData(PackageItemInfo.java:227)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.parseProviderInfoXml(AppWidgetServiceImpl.java:1264)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.addProviderLocked(AppWidgetServiceImpl.java:1162)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.loadAppWidgetList(AppWidgetServiceImpl.java:1148)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.ensureStateLoadedLocked(AppWidgetServiceImpl.java:391)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetServiceImpl.systemReady(AppWidgetServiceImpl.java:211)
    
    W/PackageManager( 2130): at com.android.server.AppWidgetService.systemReady(AppWidgetService.java:156)
    
    W/PackageManager( 2130): at com.android.server.ServerThread$1.run(SystemServer.java:1882)
    
    W/PackageManager( 2130): at com.android.server.am.ActivityManagerService.systemReady(ActivityManagerService.java:8250)
    
    W/PackageManager( 2130): at com.android.server.am.ActivityManagerService$9$1.run(ActivityManagerService.java:8152)
    
    W/PackageManager( 2130): at android.os.Handler.handleCallback(Handler.java:615)
    
    W/PackageManager( 2130): at android.os.Handler.dispatchMessage(Handler.java:92)
    
    W/PackageManager( 2130): at android.os.Looper.loop(Looper.java:137)
    
    W/PackageManager( 2130): at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1563)[/COLOR]
    Here is a great example of the warning class showing missing resources.
    
    [COLOR="red"]I/dalvikvm( 1853): Could not find method android.app.IActivityManager.resizeArrangedWindow, referenced from method android.app.ActivityManager.resizeArrangedWindow
    
    W/dalvikvm( 1853): VFY: unable to resolve interface method 3769: Landroid/app/IActivityManager;.resizeArrangedWindow (IILandroid/graphics/Rect;)Landroid/graphics/Rect;
    
    D/dalvikvm( 1853): VFY: replacing opcode 0x72 at 0x0004[/COLOR]
    A prime example of Information class showing an "error", these will usually be listed in information class if they don't have a great impact of the functionality of the device.
    
    [COLOR="red"]F/PackageManager( 2014): Unable to backup package manager settings,  current changes will be lost at reboot
    E/DropBoxManagerService(2014):  Can't write: system_server_wtf
    E/DropBoxManagerService(2014):  java.io.FileNotFoundException: /data/system/dropbox/drop21.tmp: open failed: EROFS (Read-only file system)
    E/DropBoxManagerService(2014):  at libcore.io.IoBridge.open(IoBridge.java:416)
    E/DropBoxManagerService(2014):  at java.io.FileOutputStream.(FileOutputStream.java:88)
    E/DropBoxManagerService(2014):  at java.io.FileOutputStream.(FileOutputStream.java:73)
    E/DropBoxManagerService(2014):  at com.android.server.DropBoxManagerService.add(DropBoxManagerService.java:208)
    E/DropBoxManagerService(2014):  at android.os.DropBoxManager.addText(DropBoxManager.java:272)
    E/DropBoxManagerService(2014):  at com.android.server.am.ActivityManagerService$13.run(ActivityManagerService.java:8281)
    E/DropBoxManagerService(2014):  at com.android.server.am.ActivityManagerService.addErrorToDropBox(ActivityManagerService.java:8288)
    E/DropBoxManagerService(2014):  at com.android.server.am.ActivityManagerService.handleApplicationWtf(ActivityManagerService.java:8099)
    E/DropBoxManagerService(2014):  at com.android.internal.os.RuntimeInit.wtf(RuntimeInit.java:329)
    E/DropBoxManagerService(2014):  at android.util.Log$1.onTerribleFailure(Log.java:103)
    E/DropBoxManagerService(2014):  at android.util.Log.wtf(Log.java:278)
    E/DropBoxManagerService(2014):  at android.util.Log.wtf(Log.java:255)
    E/DropBoxManagerService(2014):  at com.android.server.pm.Settings.writeLPr(Settings.java:1115)
    E/DropBoxManagerService(2014):  at com.android.server.pm.PackageManagerService.unloadMediaPackages(PackageManagerService.java:9314)
    E/DropBoxManagerService(2014):  at com.android.server.pm.PackageManagerService.updateExternalMediaStatusInner(PackageManagerService.java:9128)
    E/DropBoxManagerService(2014):  at com.android.server.pm.PackageManagerService.access$3800(PackageManagerService.java:165)
    E/DropBoxManagerService(2014):  at com.android.server.pm.PackageManagerService$10.run(PackageManagerService.java:9017)
    E/DropBoxManagerService(2014):  at android.os.Handler.handleCallback(Handler.java:615)
    E/DropBoxManagerService(2014):  at android.os.Handler.dispatchMessage(Handler.java:92)
    E/DropBoxManagerService(2014):  at android.os.Looper.loop(Looper.java:137)
    E/DropBoxManagerService(2014):  at android.os.HandlerThread.run(HandlerThread.java:60)
    E/DropBoxManagerService(2014):  Caused by: libcore.io.ErrnoException: open failed: EROFS (Read-only file system)
    E/DropBoxManagerService(2014):  at libcore.io.Posix.open(Native Method)
    E/DropBoxManagerService(2014):  at libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
    E/DropBoxManagerService(2014):  at libcore.io.IoBridge.open(IoBridge.java:400)
    E/DropBoxManagerService(2014):  ... 20 more[/COLOR]
    Here we have the Fatal and Error classes.

    Ok, so now we have seen some examples, lets learn to decipher them:highfive:

    The beautiful thing about these logs is that they tell you exactly what and where everything is, as long as you know what you're looking at.
    I'm only going to use the one line to show you how to read a log, as the format is exactly the same for any class.
    Code:
    E/DropBoxManagerService(2014):  at com.android.server.am.ActivityManagerService.addErrorToDropBox(ActivityManagerService.java:8288)
    
    So here we have the printed error from logcat, the format used is as follows
    Class/Process/Location
    [b]Important! The log WILL NOT tell you what apk or jar the error occurs in, this is the hardest part of debugging![/b]
    
    In the above error we see
    Class = E/
    Process = DropBoxManagerService
    Location = com.android.server.am.ActivityManagerService.addErrorToDropBox(ActivityManagerService.java:8288) (Folder directory.File Name. Method)
    
    I know from all my digging that the specified path is in services.jar so once I have services.jar decompiled I'll follow the path laid out. (Decompile "apkname".odex for odexed roms and classes.dex for deodexed roms)
    These paths will always be located in the smali folder! For example I open my classes.dex folder after decompiling and see a smali folder, I'll open that and then I have options. The . after every word is a folder directory ( same as / in your computer directory )
    The specified path says com. so I'll open the com folder, next I'm directed to android, then server, then am folder.
    Now I should see a bunch of files and possibly some folders, [b]if there is no folder name that matches the next directory it is a file![/b]
    ActivityManagerService is a filename, so I'll open that file using NotePad++ and search for the specified method which is addErrorToDropBox.
    From here I can use another file to compare the lines to find my error, or I can know exactly where the error occured and report my problem to a helpful dev or member.

    I hope that this has been a good learning experience and will help you to understand any issues you are facing.
    :victory:
    70
    Bootloops and Filtering your logs

    Getting a Logcat during the dreaded Bootloop

    The only difference between grabbing a logcat while running and grabbing one during a bootloop is the program you're going to use. Instead of the standard adb bridge, we'll be using the adb monitor tool. You can find this tool under the "TOOLS" folder. Open the "Tools" folder, right click on any empty space and select "Open Command Window Here"
    Once the window is open, type "monitor" (without the quotes) and press enter. A whole new program will open listing the device ID and subfolders (your devices partitions)
    IMPORTANT! The device ID may not show up right away, THIS IS OK! I found that it took about three bootloop cycles to actually connect.
    Once you see the device ID, within a few seconds you should see the "system" partition listed underneath. Select it.
    Down in the bottom left corner select the "Logcat" tab. From here, you can grab the logcat in a txt format or just watch it scroll.
    I have taken screenshots of the process, and are available here

    There's a great guide here that goes a little more in depth and has updated information about the requirements for a log during bootloops.


    How to Filter your Logcat

    Lets say you want to find only the logs for a specific app or process, searching through thousands of lines can be a pain. Luckily, adb allows you to filter your logs based on application tags!
    Here's how:
    Code:
    adb logcat ActivityManager:I MyApp:D *:S

    This filter basically says "Show me only logs for ActivityManager at an Information or above level, and all logs for 'MyApp' with a priority level of Debug and higher" The *:S is important here, this makes all other tags Silent so that it ensures only the filtered tags are shown in your log.How's that for handy?


    Demesg (kernel) Logs

    For a demesg log you'll want to follow the same instructions as above to get into adb terminal.
    Once there, type adb devices to verify you're connected. Now you can pull a log by simply typing "adb shell dmesg > dmesg.txt" (without the quotatons" This will place the logs in the same folder that you launched terminal from (platform-tools)

    Also, for more detailed information and a few other useful commands check out this site
    49
    Apps and Reference

    Apps for grabbing Logcats


    Mobile Apps

    alogcat

    This app is great for seeing your logs, especially on older Android versions. The biggest issue I have with this app is that the share function doesn't work properly on jellybean. Yet...
    You can grab it here

    CatLog

    I personally have no experience with this app, but it's highly rated in Play Store and has an easy to use User Interface.
    Grab it here

    getlogs

    This is my favorite of these apps, I can use it to grab almost any log I want. Highly recommended for any developer, themer, or enthusiast!
    Simple, clean, effective. The way getting your logs should be:D
    Grab it here

    Logcat Reader

    Grab it here

    Logcat Extreme

    This one looks pretty cool, it has a "floating logcat" feature. Grab it here


    PC Applications

    A pretty neat logcat tool is AIOlog found here, contains versions for Windows, Linux and MacOS's by 32 and 64 bit systems.


    Here's a neat tool for you windows users, an AIO Logcat manager. Grab it, and view the orignal thread here

    Another for you windows users, Easy Logcat Maker is an executable GUI that looks pretty neat.

    Another cool logging tool is here created by the genius behind VTS!

    A new Windows tool by @FuzzyMeep Two, the aptly named Logcat Tool will parse your logcat to show you how many of each entry your logs contain, and then it organizes your logs into separate files based on the type of entry (Warning, Error, Verbose, etc...), and more! This could easily become my favorite desktop method of grabbing logs.
    Misc. Apps and Tools

    For those of you using linux there is a neat tool that color codes your logcat output to make it easier to read. You can find it here

    Not a logcat app, per se, but a pretty entertaining and live logcat boot animation courtesy of @Chainfire can be found here. Download it and see your device boot in real time!


    There are a lot more apps available than what I've covered here. These are simply the most widely known (possibly with the exception of getlogs) and widely used/recommended. If you find or make any more of these apps, please feel free to post the link here and share with the community!

    PLEASE NOTE THAT IT IS AGAINST XDA RULES TO LINK TO PAID APPS, SO DO NOT LINK TO PAID SERVICES OR THE POST WILL BE REPORTED AND LIKELY REMOVED

    Reference Links:
    Googles Logcat Help Pages
    How to get useful logs by tonyp
    Guide to logcats provided by Deadly
    Color Coding Your Logcat World


    Please be sure to thank the developers of these fantastic tools for their time and efforts!
    24
    For some reason every time I try to run a logcat I get this

    Sent from my SPH-L710 using xda premium