FORUMS
Remove All Ads from XDA
Honor 7x
Win an Honor 7X!

[Universal] [Flashable] [Logcat] [Guide] So your test ROM build didn't boot

549 posts
Thanks Meter: 1,451
 
By USA-RedDragon, Senior Member on 28th November 2015, 05:43 AM
Post Reply Email Thread
Hello all,

I've noticed the lack of a guide for pulling ADB logs for developers. Being a developer, I wanted a quick link to send people to, rather than reexplaining.

If you are looking for a GENERAL explanation on how to get a logcat, or setup your computer for pulling a logcat, look at this amazing guide here:
http://forum.xda-developers.com/show....php?t=2274119

Consider this guide an extension for the above thread, making an easy how-to for developers to point people to.

What this guide is NOT:
- A guide on how to pull a logcat in general
- A guide on how to setup adb on a computer

This guide is/will:
-Assume you know how to connect via adb
-Assume you have installed drivers and adb
-A way to show common users to get the logs the developers need

So I personally build for devices I don't own. A LOT. So, should it bootloop(specifically this) or not boot at all, I NEED these logs to help fix the problem. Most users are willing to do so..... as long as you teach them. So this is my one-size-fits-all guide to this.

Note: Later, I will do a write-up on how to pull kernel logs as an extension to this in the second post

To pull a logcat during a bootloop, you need to have adb permissive. This can be done several ways. I have added to the build.prop manually before but that was in TWRP and is a pain to guide users on. It's SUPPOSED to be done with the ramdisk, but I can't ask users to pull their ramdisk and edit it and reflash. So I have made a flashable zip to extract ramdisk and add a permissive adb property to default.prop

The zip will be in the downloads below, all you need to do is flash it when you see a ROM is bootlooping.

Note: Some kernels may not work with this, and it's based off of Anykernel. If the zip fails, don't worry, it has a fallback that it will add same thing to build.prop, and that should usually work.

After flashing, hook the phone/tablet up to your computer and run this in your Terminal:
On Linux:
Code:
adb logcat >  ~/log.txt
That will store logcat into your home folder.
On Windows:
Code:
adb logcat >  %UserProfile%/Desktop/log.txt
That will store logcat on your Desktop.

How do I stop logging?
You can either stop logging by hitting [CTRL] + C in the terminal or by unplugging device.

How do I know when to stop logging?
Usually, you can safely stop logging after about one minute for MOST problems, BUT I believe 5 minutes of logging would be the best bet to stop logging, so all the errors are caught.

How do I get the log to the developer?
You can get a log to a developer by Dropbox, Google Drive, or a file sharing site, but personally I like pasting sites like hastebin.com, pastebin.com, or paste.ubuntu.com. This is a developers/users personal preference though. Personally, I really, really like hastebin. For a pasting site, just open it in your browser and open the log with notepad or equivalent, and do [CTRL] + A and [CTRL] + C to copy the whole log, then paste onto the site. Then share the link the site gives you with the developer.

How do I get the log, when I didn't even get to the boot animation?
Usually, this is a kernel problem, and is almost deserving of it's own write-up, and instructions will be available in the second post.

Thank you all, and should you see a problem, or need more questions answered, please tell me so in replies.

Keep it cool,
Jacob(USA-RedDragon)
Attached Files
File Type: zip LogcatFlasher-0.1.zip - [Click for QR Code] (877.7 KB, 1568 views)
The Following 12 Users Say Thank You to USA-RedDragon For This Useful Post: [ View ] Gift USA-RedDragon Ad-Free
 
 
28th November 2015, 05:43 AM |#2  
So your kernel didn't boot. Well dang. This can be one of the worst problems. So, I'm going to HOPE you have TWRP, since CWM is pretty much dead.

This is more advanced, because you have to use Terminal command in TWRP.

Now, don't be daunted by this, since it's terminal commands, it's quite easy.

As a general rule of thumb(there are different devices with different kernel logs, though), 3.10 kernels(pretty much anything in the last 2 years) have a log in /sys/fs/pstore/console-ramoops and 3.4 and prior kernels have /proc/last_kmsg.

You can see kernel version in Settings -> About Phone

So to pull these logs, you need to be in TWRP DIRECTLY after a failed boot.

Go to Advanced->Terminal Command and type these commands in. One will fail the other will work. Should both of them fail, restart and try to boot again, then go back to TWRP.

Code:
cp /proc/last_kmsg /sdcard/kernellog.txt
Code:
cp /sys/fs/pstore/console-ramoops /sdcard/kernellog.txt
Now you can restore your backup and boot normally. Once you've booted up, you can either share the files with Google Drive or Dropbox or whatever in Android, or you can pull them to your computer with these Terminal commands:
On Linux:
Code:
adb pull /sdcard/kernellog.txt ~/kernellog.txt
That will store log into your home folder.
On Windows:
Code:
adb pull /sdcard/kernellog.txt %UserProfile%/Desktop/kernellog.txt
That will store log onto your Desktop.

Then share log like you would in the above post
The Following 10 Users Say Thank You to USA-RedDragon For This Useful Post: [ View ] Gift USA-RedDragon Ad-Free
3rd February 2016, 05:54 PM |#4  
Senior Member
Flag Sion
Thanks Meter: 238
 
Donate to Me
More
when I execute the command, it says waiting for device.
I have a galaxy s5

and the monitor, my device is offline
26th February 2016, 07:52 PM |#5  
HasH_BrowN's Avatar
Senior Member
Flag Leesburg
Thanks Meter: 40
 
More
@Gayos24 what command did you type??? OP and 2ND post show numerous commands. Nobody can help if you don't give details.

The monitor says device offline...is the screen turned on??
26th February 2016, 08:08 PM |#6  
Senior Member
Flag Sion
Thanks Meter: 238
 
Donate to Me
More
Quote:
Originally Posted by HasH_BrowN

@Gayos24 what command did you type??? OP and 2ND post show numerous commands. Nobody can help if you don't give details.

The monitor says device offline...is the screen turned on??

i type this command adb logcat > %UserProfile%/Desktop/log.txt

yes the screen turning on.
26th February 2016, 08:39 PM |#7  
HasH_BrowN's Avatar
Senior Member
Flag Leesburg
Thanks Meter: 40
 
More
@Gayos24 you use that AFTER you run a logcat, there is a link in the OP on how to do that.
26th February 2016, 09:04 PM |#8  
Senior Member
Flag Sion
Thanks Meter: 238
 
Donate to Me
More
Quote:
Originally Posted by HasH_BrowN

@Gayos24 you use that AFTER you run a logcat, there is a link in the OP on how to do that.

yes
24th March 2016, 07:48 PM |#9  
rachit011's Avatar
Member
Thanks Meter: 9
 
More
I flashed logcatflasher zip via twrp and connected my device. I wrote command for windows but there was no logging in the terminal
2nd April 2016, 05:03 PM |#10  
Member
Thanks Meter: 7
 
More
But the adb via usb need an authorization to enable,how to get pass when bootloop?

Sent from my MI 2C using XDA-Developers mobile app
17th June 2016, 09:26 PM |#11  
Senior Member
Flag Sion
Thanks Meter: 238
 
Donate to Me
More
Quote:
Originally Posted by Sun Shower

But the adb via usb need an authorization to enable,how to get pass when bootloop?

Sent from my MI 2C using XDA-Developers mobile app

use adbd
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes