Nice guide you put together here. This should be in general Android forums. I especially like the third post.
Please tell me what type of log to use for checking wifi.We're on a development site - at least in theory.
To help out development without actually having some knowledge it's really important to know how and when to get logs.
Lately more and more people in this section do grab appropriate logs, which is a good thing and has already helped in fixing a bunch of bugs.
To stop (especially new) people from constantly asking how to get logcats I decided to hand out a quick reference on how to grab logs efficiently via adb / terminal / app.
There is an app which can export apps (see the end of this post), but you should learn how to get logs via adb anyways, as a dmesg is often crucial in case of debugging bsods.
I won't post instructions in how to get adb working - you can use Google or take this CM wiki entry as a starting point.
The three most important log types are:
- logcat: the logoutput of the Android system
- radio logcat: the log outpur ot your System / BB / RIL communication
- kernel log (kmsg / dmesg): the kernel messages
Additionally there's the last_kmsg which is a dump of the kernel log until the last shutdown.
Normal Logcat:
Code:adb logcat -v time -d > logcat.log
Radio Logcat:
Code:adb logcat -b radio -v time -d > logcat_radio.log
Note: Cyanogenmod (based) ROMs require the following setting to export kernel logs via adb:
Settings - Developer Options - Root access - choose: "Apps and ADB"
Kernel Log:
Code:adb shell su -c dmesg > dmesg.log
Last_kmsg:
Code:adb shell su -c "cat /proc/last_kmsg" > last_kmsg.log
For getting the logs via the Terminal Emulator app the commands differ a little:
Notes:Get logs via Terminal Emulator:
Normal Logcat:
Code:logcat -v time -d > /sdcard/logcat.log
Radio Logcat:
Code:logcat -b radio -v time -d > /sdcard/logcat_radio.log
Kernel Log:
Code:su -c dmesg > /sdcard/dmesg.log
Last_kmsg:
Code:su -c "cat /proc/last_kmsg" > /sdcard/last_kmsg.log
- -v time will include timestamps in the logcats
- -d will export the complete log.
If you want to save a continuous log you can remove the -d parameter - then you need to cancel the logging process via CTRL+C.
To export a continuous kernel log use adb shell su -c "cat /proc/kmsg" > dmesg.log (and cancel it via CTRL+C again).
Exporting logs with an app:
I used to recommend Lumberjack for grabbing logs, but it doesn't work with Jellybean properly anymore and fails to export the dmesg.
I googled for a while and found a great (and fully open sourced) alternative to export logs: SysLog
With this great app there are no more excuses - at least open the app, export all 4 log types and attach the zip file from /sdcard/SysLog to your bug report.
Before anyone asks (duh!), Kernel log = dmesg, Last kernel log= last_kmsg, main log = logcat, modem log = radio log.
Lumberjack still is great to have a look at logs on the phone, but for exporting you probably should use SysLog as it does it quickly and reliable
SysLog (source):
Can somebody typ step by step to make a Logcat while in TWRP and setup a custom ROM please?
I'm not experienced with that.
What are you even asking?
"make a logcat while in TWRP?"... "setup a custom ROM please"
... What?
Try explaining what you're trying to accomplish in detail.
Ok. Im aware to make a Logcat with a Terminal Emulator on my device.
But I want to make a Log when flashing a new Custom ROM (Omni Rom) because I get FC and Pop ups even in clean install ROM and Gapps. So I think it works with PC and ADB or so... But that I'm asking for here in this thread.
Idk can you understand that question now? Thanks
Use the XDA search box to find a guide on how to install, setup and use ADB/Fastboot on your PC. Then you can record logs via terminal prompt.
There are many tutorials available on how to setup and use ADB/Fastboot on a PC(Windows, Mac, Linux...etc). A simple Google search should also be helpful in finding guidance.
adb logcat -v time -d > logcat.log
adb logcat -b radio -v time -d > logcat_radio.log
adb shell su -c dmesg > dmesg.log
adb shell su -c "cat /proc/last_kmsg" > last_kmsg.log
logcat -v time -d > /sdcard/logcat.log
logcat -b radio -v time -d > /sdcard/logcat_radio.log
su -c dmesg > /sdcard/dmesg.log
su -c "cat /proc/last_kmsg" > /sdcard/last_kmsg.log
Thank you for this little tutorial, you helped a lot. But I am thinking about if its not possible to watch phone logs live on you pc, while your phone is connected via USB.