> cd TR-Debug
> adb logcat -c
> adb logcat >Camcorder.txt
- stty -ixon
- ReBoot the device
- ctaylor@dusty-tr2:~/Android/TR-Debug
> adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
HT19PS20**** device
- Clear your Gallery from the previous tests ... IF any.
> adb logcat -c --- Clear the logs
- Start up the Camera/Camcorder and do the first two recordings.
Use the CyanogenMod camera NOT the Google one!!
a. Put it in Video mode.
b. Took first two and then got out of Camera and looked in Gallery. Both
were crap!! I used portrait mode!! -But- we have two.
c. Back in and this time start a log just before or at the same time we
start the recording.
- > adb logcat -C >Camcorder.txt --- Everthing -and- in color.
- Stop recording and ^C.
- Now we want to do it again... only this time with some filtering.
Repeat steps 2 thru 5 ... then do this:
> adb logcat -C *:W >Camcorder-2.txt --- Filtered and in color. Extra couple of tries
that would not work.
- Examine the files... just produced.
July 23rd, 2014/8:41am
How to get & read a logcat/ Troubleshoot your own issues!
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:
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
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.
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
Important! The log WILL NOT tell you what apk or jar the error occurs in, this is the hardest part of debugging!
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, if there is no folder name that matches the next directory it is a file!
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.
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)
Google Debug Info
Comments...