yashsingh1/xdaforums huggingface dataset:
[Android General] justmpm:
Your device is writing all this information into a circular buffer pretty much all the time and logcat is a convenient way to get it, so logcat is not a service that is running all the time, but it is taking advantage of a service that is running all the time. There are probably a lot of ways to get it, but logcat is pretty easy. If you want to see the entire log and not just starting at the time you enter the logcat command use: logcat -d This dumps the entire log onto the screen and then exits....you can copy and paste it into a text editor pretty easily. This can be pretty big....you can run logcat -c which will clear the log out....recreate the error and then use logcat -d ....but it's probably just easier to save it to a file.....

One nice trick is that you can use any copy of adb to get a logcat...so you don't need a full blown sdk install to get one....I use the adb in flashtool all the time, since my cmd window is usually in that directory anyway......

Great post btw....should be a sticky in every dev forum.
[Android General] justmpm:
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:

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.
[Android General] triptosyll:
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!!!
[Android General] goatee84:
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.
[Android General] dcharleyultra:
What are the commands you are running in TE?
[Android General] goatee84:
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.
[Android General] vis80k:
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.
[Android General] goatee84:
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 :)
[Android General] dheeraj (dhlalit11):
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
[Android General] Deadly:
Vis80k had just written it above 2 posts...
[Android General] Dilesh Perera:
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
[Android General] FuzzyMeep Two:
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.
[Android General] Warrior1975:
Great thread. Thanks so much for sharing, been wondering how to do this.
[Android General] Deadly:
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..
[Android General] Megalith27:
Thanks for the reply. But I actually never touched apks...just copied them across two zipped roms.
[Android General] Deadly:
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...
[Android General] Megalith27:
Thanks, i resigned apks using kitchen....do i need to resign jars too?

Sent from my A953
[Android General] Deadly:
nope.. try flashing it.. and no need to say thanks ;) just hit it:)
[Android General] Megalith27:
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?
[Android General] prboy1969:
Just wanted to say Thank you for a great guide :)
[Android General] Deadly:
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
[Android General] Nschneider7:
OK so mildly confused. I'm trying to use ADB to check why the wireless is causing my tablet to freeze up so I can post the logcat on xda. However when I type adb logcat > name of problem.txt do i have to type something else after and where is the file now? I'm having trouble trying to figure that part of it out.
[Android General] goatee84:
If you haven't specified a location then it will be in your adb folder. Wherever adb.exe is located, eg. mine is in C:\Android but that's because I put it there for ease of access.
[Android General] Nschneider7:
Ok thanks wasn't sure also don't know why I didn't think to check there seeing as how I was already using adb.
[Android General] Lookitfast:
Edit...Delete
[Android General] TecQuality:
aLogcat runs onto CM10? I've noticed that it was broken. ;)

Sent from my GT-I9300 using latest Nightly
[Android General] Pkt_Lnt:
It will work if you convert it to a system app rather than a user app via adb or titanium backup or other techniques. Some permissions changed for user apps in 4.1, and reports are more restrictions in 4.2 just released.
[Android General] TecQuality:
Okay, but catlog works flawlessly right? :)

Sent from my GT-I9300 using latest Nightly
[Android General] Pkt_Lnt:
(shrug) dunno

I bought aLogcat some time ago and that is what I use.
[Android General] FuzzyMeep Two:
logcat tool makes posting to XDA easier

http://code.google.com/p/logcat-tool/downloads/detail?name=logcatTool.exe&can=2&q=
[Android General] Androidspecialforces:
Thank You for the tutorial.
[Android General] dcharleyultra:
What do you mean by extract it? Is the ROM a zip file?

Swyped from my SPH-L710
[Android General] 1ackass:
yaay, with no hacking experience except in linux, i managed to hack kid mode in 3 mins lol :D
[Android General] Kollagen:
I am trying to diagnose why Bluetooth is not working on my i9100G, but I am having a very hard time finding a suitable command line to use with adb logcat. adb logcat -v long is of course far to extensive to be of use. I thought of using something like adb logcat BluetoothAdapterStateMachinee:E *:S -v long, but am unsure if that's enough or if I should add a couple more things with *:S. What would you suggest me?
[Android General] Kollagen:
Anyone?
[Android General] Chukudu:
Now i get it

Now i understand what logcat is for.. Thank you.. :)
[Android General] ghandil:
Thanks for great tutorial;

I've got a general logcat successfully;But my particular problem is connecting to the VPN (on any 4+ ROM) so i'm going to do a logcat related to VPN only. (as your WifiStateMachine one on the first post).

Tried 'LegacyVpnRunner' in this way :

adb logcat LegacyVpnRunner:E *:S -v long > name of problem.txt

But the final txt was this:

adb server is out of date. killing...
* daemon started successfully *
--------- beginning of /dev/log/system

--------- beginning of /dev/log/main

What's the problem? did I use a wrong alias for VPN service? (LegacyVpnRunner) if so, Where is the referernce to find related aliases for any android service?
[Android General] electech13:
Quick question:

Is this also the preferred method or tool to use for devs to get info on crashes/reboots of any given ROM?

I've used log cats for app issues and FC's but what about when system freezes and reboots..is this best way/info to obtain after system is back up again to then send to ROM devs?

Thanks
[Android General] mrrogers1:
Here's how to get it for reboots

How to get last_kmsg log

If your tablet rebooted unexpectedly, you need to save last_kmsg log. It will contain kernel log just before reboot and may show what caused reboot.

To get last_kmsg log on your device you need to do:

Open terminal app

Enter "su" to get root privileges

Enter "cat /proc/last_kmsg > /sdcard/last_kmsg.txt" to save current log.

Close terminal app.

To save last_kmsg log with adb shell you need to run "adb shell cat /proc/last_kmsg > /path/where/save/last_kmsg.txt" from command line on your pc.

Source - http://code.google.com/p/tegraowners-ics-rom/wiki/How_to_get_logs
[Android General] MysticCobra:
I'm having a problem where my phone locks up overnight (screen is black but silkscreened buttons at bottom are illuminated; phone is unresponsive, even to 3-finger salute--have to pull batt to recover).

I am trying to figure out how to pull useful log data to troubleshoot. Tried the last_kmsg suggestion above, but there was no file named "last_kmsg" in the /proc directory.

Did not find this thread until after I'd rebooted, so don't know if phone would respond to adb commands from laptop (I suspect it won't).

Any other suggestions for gathering data behind a lockup problem? Maybe start a logcat capture before going to bed, then scanning it in the morning to see what I got? Would it be best to do that on the phone or from the laptop?
[Android General] electech13:
Thanks for the info....so is this last kmsg the best log info to get/provide to a dev after a ROM crash?

And from the sounds it I can do the last kmsg without any prior setup, correct? I don't have to turn on or activate any log first for that one is what I'm asking.

Thanks
[Android General] Jamalsid:
Unless you where actively running a logcat when the crash happened I believe the last_kmsg is the only log you can get after a reboot that

might

help, it is not guaranteed to contain any useful info.

You are correct that no prior setup is required. I should be possible to write a script that can automate this for you using scriptmanager. You could then set it to either run at every boot or just have a link on your desktop that you just need to click when required. I don't have the knowledge to write it though :laugh:
[Android General] Brute.Force:
OK i did logcat but how do you find which file has the bug and which value to change. Like the cm9 for my phone has some bugs from the start which are still present. And now all the ported roms have same bugs.

Any serious help would be appreciated
[Android General] FrozenTears:
Thanks

very usefull ............ Saved as PDF
[Android General] schrizzity:
Oh thanks. I was wondering how to get useful info from the ROM crashes.
[Android General] Rated RR:
Site to upload logcat log file?

I ran across some post that had a link to the web site where you can upload a logcat file where it formats the lines nicely.

Unfortunately, I cannot find this post anymore. Anyone knows of such site?

EDIT: Arrrrgh, just found it: http://pastebin.com/ :)
[Android General] Deadly:
Pastebin.com

____________________________________

UltimaTIME Clock Widgets, 200 clock widgets in one!!:eek:

Falling Doesn’t Make You a Failure, Staying Down Does
[Android General] 9m2bal:
Free pastebin at pastebin.ubuntu.com.
[Android General] wilvic:
Thanks

..thanks man, I'm a noob, at least now i know how to.

..i did hit the thanks button:laugh :laugh:
[Android General] milicigoran:
I'm sorry if it's a dumb question but I didn't see it in the op. How do I attach the logcat. Txt file to Tapatalk so I can upload it to a forum?
[Android General] MechaGen:
Two or three posts above.
[Android General] zenesis:
I can't have a logcat. I have htc drivers installed and android-sdk installed. however I still can't get a logcat. It seems that even my Android Debugging is enabled but the ADB can't detect my device.

I'm on PACman v20.0.1 on HTC Desire S
[Android General] bagadj:
hello guys, just an info... if i have a freeze, i must reboot my phone... then if i open catlog is it possible to check which process make this freeze?

thank you
[Android General] Deadly:
yes, you can.. but only if you use "logcat" instead of "catlog"

____________________________________

“If you wait to do everything until you’re sure it’s right, you’ll probably never do much of anything.” –Win Borden
[Android General] maros6666:
Hello. I have problems with my Samsung Galaxy W. I have official rom from samsung, last update. When i have 100% of battery i plug cable off. Then i surf on internet by using Wifi for about 5 - 10 minutes and my phon turn off by itslef. When i turn oo my phone after about. 20 minutes system shows that my battery capacity is only 60%. So i download alogcat and here is my log:

https://www.dropbox.com/s/eyxhthupr6xmtyq/alogcat.2013-04-07-18-16-36%2B0200.txt

I have this trouble when i have full battery and i take some photos my phone turn off. Then after i turn on the phone i just go to gallery and browse pictures and phone again turn off by itself....

PLease help me with this log. I cant read this logs....Thanks

EDIT:

Here are my latest two logs:

https://www.dropbox.com/s/2lag8onr6ljhiz9/alogcat.2013-04-07-19-06-39%2B0200.txt

https://www.dropbox.com/s/bw3o25tbmxp1wvj/alogcat.2013-04-07-19-17-55%2B0200.txt

EDIT: 9.4.2013 - Here is my latest log which i have done by ADB and logcat

https://www.dropbox.com/s/y2p1q77x4cgh3u5/galaxyw.txt
[Android General] darkevilmagic:
here is the bluetooth call logcat
[Android General] dandan_00000:
hi

how can i use adb to just show anything wifi related as am having major issues getting it to turn on.. i've done it through catlog but when i view on laptop its just congested..
[Android General] Shuvodip:
Logcat for this one?

I am a newbie. I tried porting a ROM.

It didn't boot up. It is stuck at the bootanimation.

How do I get logcat for this situation?

Please help.
[Android General] FuzzyMeep Two:
Logcat tool v3

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)

New version LOGCAT TOOL V3

added HIDE tags for easier forum posting (Thank you Szczepanik)

Parses file and outputs different files for each log level (error, verbose, fatal, etc...)

example output

"I/LocationManagerService( 495): request passive (pid 9909) 0 0"
"I/LocationManagerService( 495): request passive (pid 3221) 60000 0"

LOGCAT GENERATED BY FUZZYMEEP TWO'S LOGCAT TOOL
[Android General] hello00:
delete
[Android General] RivaultUser:
Thx man, now I can help developers
[Android General] Px80:
how long can i track back issues with the logcat?

i got sometimes random reboots and im wondering how long i have until the logs are deleted or overwritten?

Are there any personal information in logcats which i shall remove before i post it?
[Android General] Flagmax:
A new logcat is created every time you boot the device. So if are bootlooping, then it best to use adb on your computer to get the log.

As for personal info, it depends on type of error and where it is. For example if WiFi is turned on, then usually you will find your MAC address in the log. But I've never seen things like Esn, Meid, MSN, Min in my logs. So its best to go through your logs before posting.

If I am wrong someone please correct me.
[Android General] Px80:
I get sometimes random reboots, so how to check on that? Because ma phone is not always connected to the pc.
[Android General] Jonnyredcorn:
I am having the same issue. I am using my PC to try to capture the logcat, and in the text file I get the same "Unable to open log device 'dev/logmain': No such file or directory". You say you found an init.d script removing it how can I go about finding that?
[Android General] Slimegod:
Quick question. My phone reboots before going to the home screen. Using adb logcat how do I fix that?
[Android General] BajoPrimate:
Hi shakim24,

you could use:

adb wait-for-device && adb logcat > logcat.txt

or

adb wait-for-device && adb logcat -v long > logcat.txt

Good luck.
[Android General] Slimegod:
Appreciate it thanks.
[Android General] BajoPrimate:
You're welcome, shakim24.

All the best.
[Android General] Slimegod:
Will this work. Because I'm not even able to get past the "optimizing apps" screen without it rebooting. I understand I have to but debugging on but how am I able to do that if I can't get past the optimizing apps screen?
[Android General] BajoPrimate:
Hi shakim24,

That's what I do:

I connect my phone via USB,

then use the command line for start adb: adb wait-for-device && adb logcat > logcat.txt ,

then reboot my phone (or switch it on)

and end with control+C after 2 minutes (while it boot loops).

Good luck.
[Android General] Slimegod:
But I'm installing new ROM. And when I did that it just vibrated so I turned the phone on. So that's the command to recognize the phone, the very top command?
[Android General] BajoPrimate:
If you connect your phone (turned off) via USB ,

then use the command line for start adb: adb wait-for-device && adb logcat > logcat.txt (then enter)

then switch your phone on:

adb starts writing the logcat.txt in your computer

you could end it with control+C (while it boot loops)

Good luck.
[Android General] Slimegod:
It's telling me "adb" is not recognized as a internal or external command
[Android General] BajoPrimate:
Hi shakim24,

I thought you already had adb installed,

if not, first you should install it in your computer (for example, from here: http://developer.android.com/sdk/index.html)

Good luck.

Edited: Here you have a good guide by iamareebjamal :

[GUIDE][ADB]Easiest How to use adb, logcat, etc for noobs and newbies
[Android General] Slimegod:
Appreciate. Will let u know how everything went.
[Android General] BajoPrimate:
I'm happy to help, shakim24.

All my best.
[Android General] Slimegod:
I'm assuming it's the SDK bundle I need correct?
[Android General] BajoPrimate:
Yes, it is
[Android General] Slimegod:
This is the error I get when I put in control+C
[Android General] BajoPrimate:
Hi shakim24,

you should press (not write) two keys at the same time in your PC's keyboard:

the control key (Ctrl) and the C letter (C)

Good luck.
[Android General] Slimegod:
Will try it right now.
[Android General] Slimegod:
I tried the control C buttons and all it gave me was ^C. Is that is what's suppose to happen?
[Android General] BajoPrimate:
Hi shakim24,

After that you'll have your logcat.txt

ready.

Open it with a text editor.

Ctrl +C just stops the recording of the cat.

Good luck.

Sent from my GT-S5830 with Miracle Reloaded 1.6.13 and Fly-On
[Android General] Slimegod:
Got do I open it with text editor and once I do that is there another command I need to input?
[Android General] BajoPrimate:
No,you don't need any more ; if your logcat. txt is written.

Good luck.

Sent from my GT-S5830 with Miracle Reloaded 1.6.13 and Fly-On
[Android General] Slimegod:
Ok will try it in a few.
[Android General] Slimegod:
Yeah this logcat isn't working for me smh. Phone keeps rebooting even after I put the command in. The steps I've been taking are the ones I've been told. Just not working for me. Thanks anyway.
[Android General] BajoPrimate:
Hi shakim24

The logcat just gives you information about the problem.

You could use that information to fix it, if you know how to, or send it to a developer.

Good luck.

Sent from my GT-S5830 with Miracle Reloaded 1.6.13 and Fly-On
[Android General] Slimegod:
I'm not even able to get a logcat . Its saying "waiting for device". Had it plugged up for 15 minute.
[Android General] BajoPrimate:
Hi shakim24 ,

Did you install your phone's drivers in your PC?

If not, look for them (via Google) and install.

Good luck.

Sent from my GT-S5830 with Miracle Reloaded 1.6.13 and Fly-On
[Android General] Slimegod:
Yeah I did.

---------- Post added at 08:11 PM ---------- Previous post was at 08:10 PM ----------

It recognized it and everything and it still wouldn't run the logcat.
[Android General] BajoPrimate:
Hi shaking,

Perhaps you should install adb in your root directory (directly in C:/) not in user /....

Perhaps your current adb path is too long. (I'm not sure)

You could try installing again in the right place. (Or copy the full directory to C:/)

Good luck.

Sent from my GT-S5830 with Miracle Reloaded 1.6.13 and Fly-On
[Android General] Slimegod:
How do I install it directly into my root directory? And the command that you had given me, once I do get it running, will stop the bootloop?

---------- Post added at 09:52 PM ---------- Previous post was at 08:59 PM ----------

Because the issue I'm having is it'll get past the boot animation and go to the setup screen and then reboot like it's loading again.
[Android General] BajoPrimate:
Hi shakim24,

The easiest way is to

move the folder

adt-bundle-windows (or only platform-tools) from its current location to C:\

Do it as usually, in windows there are many ways of moving files/folders:
​

for example search the directory adt-bundle-windows right-click on it and in the emergent menu select move to folder and select C:

With the command adb wait-for-device && adb logcat > logcat.txt (enter)
​

and afer 1-2 minutes Ctrl+C

you'll just get a file (logcat.txt) in your C:\adt-bundle-windows\sdk\platform-tools.

The logcat just gives you information about the problem (within the file).

You could use that information to fix it, if you know how to, or send it to the developer and kindly request him to fix.
​

Good luck.
[Android General] Slimegod:
I understand you had a rebooting problem as well did you fix your situation on your own and if so how were you able to do it.

---------- Post added at 10:36 PM ---------- Previous post was at 10:30 PM ----------

Btw the adt bundle file is in my C drive, guess I'll try moving it to another file.
[Android General] BajoPrimate:
Hi Shakim24,

The first time, I was testing one developer's rom and he was interested in the logcat for himself -he wanted to fix the rom and he had not the device- the developer required the logcat.
​

The second time was a similar case (and at the moment the developer has not fixed it)

The third and last time -at the moment-, I installed a new launcher and got FC,
​

I didn't make the last nandroid backup:crying:( too bad for me) and a lot of apps installed ,

but I knew the new launcher was probably the responsible of the FC

then I unistalled the new launcher via adb and my phone booted again without FC:D.

That's all , I'm not a developer but I like it.

Good luck.

---------- Post added at 11:56 PM ---------- Previous post was at 11:47 PM ----------

You could move it from C:\Users\.. ...\Dowloads\adt-bundle.....\sdk\...

to C:\adt-bundle.....\sdk\...

Good luck.
[Android General] Slimegod:
Ok I see.