Search This thread

triptosyll

Senior Member
Jan 7, 2012
659
459
Mineral Point
I have been trying to get a logcat with just the warnings, errors and fatal errors. I have been able to get the errors and warnings with:

adb logcat *:E, *:W > errandwarn.txt

but everytime I try *:F (either by itself or as part of a command string) I get this:

Code:
C:\Flashtool\x10flasher_lib>adb logcat *:F
--------- beginning of /dev/log/main
--------- beginning of /dev/log/system

Any ideas of what to try...it would be really nice to have a single logcat with all the "important" errors.

Try this : adb logcat -v long *:W*:S > nameofyour.txt

The -v long puts the text in a nice format that is more easily readable. The *:W will search for all warnings, errors, and fatals, while the *:S will silence everything else.
So essentially, u will have a .txt file that has a log of all warnings and up, nothing else, and it'll look pretty too! :D

Bacon in my coffee, please? You don't have any bacon?!?! Unacceptable!!!
 

goatee84

Senior Member
Feb 21, 2012
127
37
Victoria
When I run logcat from terminal emulator I get this mesage: "Unable to open log device '/dev/log/main': No such file or directory"

Is this an issue with my ROM? I'd like to be able to run logcat without having to be near a computer to use adb.
 

goatee84

Senior Member
Feb 21, 2012
127
37
Victoria
Just "adb logcat". I just tried to run it on the PC though, it gave me the same response.
Also tried "adb logcat -v long > testlog.txt" just for giggles, same deal.
 

vis80k

Senior Member
Aug 13, 2011
348
20
Just "adb logcat". I just tried to run it on the PC though, it gave me the same response.
Also tried "adb logcat -v long > testlog.txt" just for giggles, same deal.

terminal emulator...running from you phone, right?

if yes,

logcat -v long > /sdcard/logcat.txt

wait just a few seconds, just in case, then press what's equivalent to "ctrl" on your phone, in my case was volume down button, and "c" on the keyboard to break out.

you should see logcat.txt in your /sdcard/ path.


"adb" is when you are connected to a pc and typing in the command from the pc's command line.
 

goatee84

Senior Member
Feb 21, 2012
127
37
Victoria
Sorry I wasn't very clear before, confused myself a bit...I was running "logcat > logcat.txt" in TE, "adb logcat etc etc" on the PC.

Found the problem anyway, there was an init.d script removing dev/log/main so I commented it out and logcat is now functioning :)
 

dheeraj (dhlalit11)

Senior Member
Sep 30, 2011
2,540
1,512
fatehabad (hry)
just thought of sharing this as it was not in the op's post, sorry if this is a repost

in terminal emulator to stop the logging press volume - button along with the c button it will act as ctrl c
 

Dilesh Perera

Senior Member
May 26, 2012
1,802
943
Colombo
Xiaomi Poco F1
Xiaomi Poco F3
Dear Friends

I need help from u....

i have Xprria Rar with Stock 4.0.4 rooted BL unlocked. since some days ago phone switch off automatically and reboot
happens everyday now

here is the logcat. if anyone knows what cause this and advice please

I dont have any idea to identify the cause

Thank U
 

Attachments

  • LOG.txt
    64.2 KB · Views: 67
Last edited:

FuzzyMeep Two

Senior Member
Feb 21, 2012
119
318
Southern NH
Logcat tool updated to v2

EDIT V3.1 DONE
FIXED OPTIONS 7 & 8, URLS WERE MISSING A "?"
CHANGELOG EDITS
SAVES AND PARSES FILES IN TO DIFFERENT OUPUT FILES BASED ON LOG LEVEL (E , I , D , W , ETC)




EDIT: BUG FIX UPDATE HERE

The last version removed a "*" on me so it had a great potential for closing itself, so i have repaired the problems.
 
Last edited:
  • Like
Reactions: paxChristos

Warrior1975

Senior Member
Jul 19, 2012
3,347
1,702
Great thread. Thanks so much for sharing, been wondering how to do this.

Sent from my SGH-T999 using xda app-developers app
 

Megalith27

Senior Member
Feb 17, 2012
549
277
Baku
I have ported a rom but it bootloop on rom animation...when I try to logcat it says "waiting for device" and logcat file remains empy and nothing ever happens.
any ideas?
 

Deadly

Senior Member
Jul 19, 2012
10,279
3,901
Bangalore
OnePlus 5
I have ported a rom but it bootloop on rom animation...when I try to logcat it says "waiting for device" and logcat file remains empy and nothing ever happens.
any ideas?
try resigning all the apks inside /system/ folder... it might be a cause of that.. or many other reasons.. use dsixda kitchen or any other tool to resign all at once..
 

Deadly

Senior Member
Jul 19, 2012
10,279
3,901
Bangalore
OnePlus 5
Thanks for the reply. But I actually never touched apks...just copied them across two zipped roms.
thats y its not working.. they have different signatures... as they are from different roms.. do this.. copy all the apk files of system/app and system/framework to some folder.. then resign them using apktools like apk multi tool or dsixda kitchen or any other tool which signs the apks... then replace the apks with newly signed ones.. it will definitely work...
 
  • Like
Reactions: Megalith27

Megalith27

Senior Member
Feb 17, 2012
549
277
Baku
thats y its not working.. they have different signatures... as they are from different roms.. do this.. copy all the apk files of system/app and system/framework to some folder.. then resign them using apktools like apk multi tool or dsixda kitchen or any other tool which signs the apks... then replace the apks with newly signed ones.. it will definitely work...
Thanks, i resigned apks using kitchen....do i need to resign jars too?


Sent from my A953
 

Megalith27

Senior Member
Feb 17, 2012
549
277
Baku
nope.. try flashing it.. and no need to say thanks ;) just hit it:)

Thanks, man, but the rom still didn't boot....i need a logcat to understand what's going wrong....


Edit: So i tested many many times with my current working rom and adb only works if the adb daemon can detect the device. If the phone hasn't booted up successfully, adb doesn't work. So a "boot-loop", when you would need logcat the most wouldn't work, and it isn't at the moment as I try it.

Any ideas?
 
Last edited:

Deadly

Senior Member
Jul 19, 2012
10,279
3,901
Bangalore
OnePlus 5
Thanks, man, but the rom still didn't boot....i need a logcat to understand what's going wrong....


Edit: So i tested many many times with my current working rom and adb only works if the adb daemon can detect the device. If the phone hasn't booted up successfully, adb doesn't work. So a "boot-loop", when you would need logcat the most wouldn't work, and it isn't at the moment as I try it.

Any ideas?

You edited the post and I didn't notice.. also I feel we shouldn't continue in this thread.. but can you send me updater script of working rom and one you are using to flash your modded one..

hit thanks button! If above post helps you..
Sent from my GT-S6102
 

Top Liked Posts

  • There are no posts matching your filters.
  • 712
    Here's how to use logcat:
    There are two main ways to do a logcat, within android, and through adb.
    Logcat within android can be done one of two ways, through a Logcat app:
    Here are two good examples are either: aLogcat or Catlog
    I prefer catlog, because in my opinion it has a little bit nicer UI. Both of these programs can dump their logs to a txt file, which is very useful for debugging. Or, you can do it in terminal emulator (same rules as running through adb(see below))

    From Moscow Desire:
    Just a little more info when doing logcat.

    Remember, Logcat will run till you end the session. ;) And it won't always create the file till you do so. It's possible you may not see the logfile for a minute or so.

    Edit: For phones/tablets with internal storage & external sd:
    (note that the location naming convention may be different depending on device)

    Open your terminal app;

    Type: logcat > /sdcard/logcat.txt (this should create it in internal memory on the tablet)

    To send to ext sd card: logcat > /mnt/external_sd/logcat.txt

    I use a tablet for example ;) Phones may have a different naming convention.

    MD

    On the other hand, using adb to run logcat, in my opinion is much more useful, because you can start using it when android boots (i.e. once the boot animation appears.)

    The code for logcat to output to a file is
    Code:
    adb logcat > name of problem.txt
    you can also do
    Code:
    adb logcat -f name of problem.txt
    how I prefer to do it is this way:
    Code:
    adb logcat -v long > name of problem.txt
    with the -v flag & the long argument, it changes output to long style, which means every line of logcat will be on its own line (makes it a little neater, imo)
    Note: When outputting to a file, you will see a newline, but nothing printed, this is normal. To stop logcat from writting to a file, you need to press ctrl+c.

    Here's where using logcat (via adb makes life really easy)
    Lets say you find a problem you're having after looking at a logcat.

    For example:
    When I was trying to use a different ramdisk, wifi wouldn't work so I got a logcat that's almost 1300 lines long (a lot of stuff happens in the background)

    So if you are searching for an error in the logcat file (it's always e/ for error, f/ for fatal. Those are the two main things that will break a system.)

    Code:
    D/dalvikvm(  871): GC_CONCURRENT freed 472K, 6% free 10224K/10823K, paused 1ms+6ms
    V/AmazonAppstore.DiskInspectorServiceImpl(  871): Available blocks: 21981, Block size: 4096, Free: 90034176, Threshold: 5242880, withinThreshold? true
    D/AmazonAppstore.UpdateService(  871): Received action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
    W/AmazonAppstore.UpdateService(  871): Confused about why I'm running with this intent action: null from intent: Intent { cmp=com.amazon.venezia/com.amazon.mas.client.framework.UpdateService }
    D/dalvikvm(  890): GC_CONCURRENT freed 175K, 4% free 9375K/9671K, paused 2ms+3ms
    V/AmazonAppstore.ReferenceCounter(  871): Reference (MASLoggerDB) count has gone to 0. Closing referenced object.
    E/WifiStateMachine(  203): Failed to reload STA firmware java.lang.IllegalStateException: Error communicating to native daemon 
    V/AmazonAppstore.UpdateService(  871): runUpdateCommand doInBackground started.
    V/AmazonAppstore.UpdateService(  871): Running UpdateCommand: digitalLocker
    V/AmazonAppstore.UpdateCommand(  871): Not updating key: digitalLocker from: 1334228488057
    V/AmazonAppstore.UpdateService(  871): Finished UpdateCommand: digitalLocker
    V/AmazonAppstore.UpdateService(  871): Running UpdateCommand: serviceConfig
    V/AmazonAppstore.MASLoggerDB(  871): performLogMetric: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
    V/AmazonAppstore.MASLoggerDB(  871): onBackgroundTaskSucceeded: Metric logged: ResponseTimeMetric [fullName=com.amazon.venezia.VeneziaApplication_onCreate, build=release-2.3, date=Wed Apr 11 13:10:55 CDT 2012, count=1, value=1601.0]
    W/CommandListener(  118): Failed to retrieve HW addr for eth0 (No such device)
    D/CommandListener(  118): Setting iface cfg
    D/NetworkManagementService(  203): rsp 
    D/NetworkManagementService(  203): flags 
    E/WifiStateMachine(  203): Unable to change interface settings: java.lang.IllegalStateException: Unable to communicate with native daemon to interface setcfg - com.android.server.NativeDaemonConnectorException: Cmd {interface setcfg eth0 0.0.0.0 0 [down]} failed with code 400 : {Failed to set address (No such device)}
    W/PackageParser(  203): Unknown element under : supports-screen at /mnt/asec/com.android.aldiko-1/pkg.apk Binary XML file line #16
    D/wpa_supplicant(  930): wpa_supplicant v0.8.x
    D/wpa_supplicant(  930): random: Trying to read entropy from /dev/random
    D/wpa_supplicant(  930): Initializing interface 'eth0' conf '/data/misc/wifi/wpa_supplicant.conf' driver 'wext' ctrl_interface 'N/A' bridge 'N/A'
    D/wpa_supplicant(  930): Configuration file '/data/misc/wifi/wpa_supplicant.conf' -> '/data/misc/wifi/wpa_supplicant.conf'
    D/wpa_supplicant(  930): Reading configuration file '/data/misc/wifi/wpa_supplicant.conf'
    D/wpa_supplicant(  930): ctrl_interface='eth0'
    D/wpa_supplicant(  930): update_config=1
    D/wpa_supplicant(  930): Line: 4 - start of a new network block
    D/wpa_supplicant(  930): key_mgmt: 0x4
    (mind you, that's 29 lines out of 1300ish, just for example)

    I then could do the following with logcat:
    Code:
    adb logcat WifiStateMachine:E *:S -v long > name of problem.txt

    and this will only print out any errors associated with WifiStateMachine, and anything which is fatal, which makes it about a million times easier to figure out what's going on!

    In WifiStateMachine:E, the :E = to look for Errors, the full list of options is as follows:
    V — Verbose (lowest priority)
    D — Debug
    I — Info (default priority)
    W — Warning
    E — Error
    F — Fatal
    S — Silent (highest priority, on which nothing is ever printed)

    You can replace the :E with any other letter from above to get more info.
    In order to filter out anything other than what you are looking for (in this case, WifiStateMachine) you must put a *:S after your last command (i.e. WifiStateMachine:E ThemeChoose:V ... ... AndroidRuntime:E *:S)

    Sources: http://developer.android.com/tools/help/logcat.html
    http://developer.android.com/tools/help/adb.html

    Update for windows users:
    Thank go to FuzzyMeep Two, Here's what he's posted for windows

    I have made a tool to simplify this for people. I will send you the .bat version, to see the validity of the file, and post the .exe for everyone else.

    http://logcat-tool.googlecode.com/files/logcatHELPER.exe

    I made this in about a half hour, so if you fnd any issues let me know. I believe i worked out all functionality issues, and do plan on expanding functionality in the future.
    (If you used his tool, here's his post, thank him for his work!)
    135
    Helpful Tool

    Here's how to use logcat.....

    I have made a tool to simplify this for people. I will send you the .bat version, to see the validity of the file, and post the .exe for everyone else.
    FIXED HUGE ISSUE CAUSING EMPTY FILES
    DOWNLOAD

    PM or post here if you run into any issues. They WILL be addressed.

    I have made a tool to simplify Logcat creation for people. The creation of this tool was inspired, and guided, by the thread started HERE by paxChristos.


    UPDATE 4.1
    Corrected an issue causing empty files.

    apparently, if the process id contained a space ( 1234) the file would parse correctly, but if the numbers came up to the parenthesis (12345) it would output an empty file named ACTIVITY(12345) with no extension.

    This was a huge issue, and i apologize for not seeing it sooner. It has been corrected, and the logcat tool works better than ever. I just ran through a 20,000 line logcat without any empty files appearing.

    a couple more things to help with stability.
    Underscores (_) will be replaced by dashes (-)
    Brackets ([]) and arrows (<>) will be replaced with paranthesis(())

    -------------------------------------------------------------------------------------------------------------

    HUGE UPDATE


    Added the ability to "SUPER PARSE" Files, which separates files into folders by log level and creates a TXT file for each activity
    Super parse DOES NOT Work with LONG format Logs.
    SUPER PARSE is in its infancy I do expect errors, please let me know if you run into anything.
    OLD STUFF


    EDIT V3.6 DONE
    Added ability to filter logcats by activity name. (logcat -s "FILTER")
    Fixed Log Level Setting


    EDIT V3.5 DONE

    NOW PROPERLY PARSES "LONG" FORMAT LOGCATS.
    Thank you to Senior Member jes0411 for pointing out the issues that lead me to create V3.4 and 3.5. If any of you have an issue please let me know. It could be hours before i get to it or weeks, but i will get to fixing it.

    EDIT V3.4 DONE

    Changed the way the date variable was handled to hopefully fix issues experienced by users of non-English versions of windows.

    EDIT V3.3 DONE

    EDIT V 3.2 Finished
    Google code won't allow any new uploads, so i uploaded the new update to XDA in a ZIP file.

    Fixed ADB Location settings, some users were having trouble if they input the ADB folder with any quotation marks in the path name, it will now automatically remove quotation marks to ensure correct syntax.
    Fixed issue with ADB Location setting not exiting to previous menu.
    Fixed issue with Log Level setting not exiting to previous menu.
    Capitalized some stuff
    Added a feature that will automatically create the selected folder if no output folder exists and the user attempts to run a log.
    Added a check when selecting an output folder that will ask if you want the folder created if it does not exist


    EDIT V3.1 DONE
    FIXED OPTIONS 7 & 8, URLS WERE MISSING A "?"
    CHANGELOG EDITS
    SAVES AND PARSES FILES IN TO DIFFERENT OUPUT FILES BASED ON LOG LEVEL (E , I , D , W , ETC)



    LOGCAT TOOL v1.1 by FuzzyMeep TWO

    I made this in about a half hour, so if you fnd any issues let me know. I believe i worked out all functionality issues, and do plan on expanding functionality in the future.

    reposted HERE

    Edit: source here.
    Batch Source

    EDIT: UPDATED TO V1.1
    added the framework to add filtering to your logcat, it is in the exe, but not utilized yet (still bugy). i have also worked out a few minor bugs in this release.
    13
    Just a little more info when doing logcat.

    Remember, Logcat will run till you end the session. ;) And it won't always create the file till you do so. It's possible you may not see the logfile for a minute or so.

    But what if you can't connect ADB to your device? You can do this

    (note that the location naming convention may be different depending on device)

    Open your terminal app;

    Type: logcat > /sdcard/logcat.txt (this should create it in internal memory on the tablet)

    To send to ext sd card: logcat > /mnt/external_sd/logcat.txt

    I use a tablet for example ;) Phones may have a different naming convention.

    Nice definition of the display terminology ;)

    MD
    11
    Very nice, but I do have a question (and I started programming for Android recently): What do you do when the system reboots while debugging (in my case musb_hdrc.ko)? I tried catlog, but the logs are empty... Is there another way to do that?

    Thank you in advance

    Use adb instead of an in-android method to capture the logs, you can start when the boot animation starts (note: Not when the kernel splash screen appears) and when it reboots, it'll automatically end. (i.e. run the following in command prompt:
    Code:
     adb logcat *:E > oh_nos_it_crashed.txt
    )

    If you're not getting to the boot animation (keeps cycling on the Kernel splash screen) then you have kernel issues, and you need a kernel that has integrated last_kmsg (a whole different ball of wax that I'm still learning about) to figure out what's going on. (kmesg's are direct kernel output)

    Maybe if someone like AdamOutler ;) ;) (or any other Dev who has a much better handle on them than myself) were to explain them, it'd help :D

    Pax
    7
    Very nicely done, now i have something i can refer people to :)