Here's a TL;DR - I can't boot into my OS,phone shuts down after being in boot screen for some time but I can boot into fastboot and recovery. I flashed another custom ROM after formatting my device but it won't change the state of affairs.
I have a rooted Redmi 4X(santoni) in which I have flashed TWRP 3.5.x I had flashed Havoc OS vanilla as the OS in it with OpenGapps ver 10.
Up until today morning it worked perfectly fine, I noticed the battery was at 3% so I plugged it in. When I tried to turn it on later, it got past the "Mi Unlocked" screen, Havoc OS startup animation was working but then the phone abruptly shut down.
However I was able to boot into fastboot with Power + volume down. I was also able to boot into recovery with Power + Both volume buttons.
First I though it was a battery issue, but the battery percentage shown in the screen when the phone is shut down showed 86%. When I boot into TWRP it also shows 86%, after some time it dropped to 85%, so nothing unusual there. I generally get 1+ days of backup.
Next I thought it was an issue with Havoc OS so I booted into TWRP, wiped the device (I selected every partition manually to wipe them) and then I formatted the phone. Then I powered off the phone and booted into recovery.
I then transferred the zip files of latest crDroid 6.x vanilla, OpenGapps ver 10 and the latest apk of Magisk to install later. I selected install from TWRP's menu and clicked on crDroid's ZIP, it completed successfully without errors (as far as I could tell). I tried to boot into crDroid, but the phone again shut down after showing boot animation for sometime.
Then I booted into recovery and connected my santoni device to my Arch Linux laptop. I opened up my terminal and ran "adb shell" which opened up a root prompt. Then I ran "dmesg > log". I then exited out of there and ran "adb pull log" on my laptop.
This is the output of dmesg.
I looked at this answer which led me down a huge rabbit hole none of which I understood. Upon running "adb shell" and "logcat" in it, I get
/sbin/sh: logcat: not found
with error code 127 in terminal ( which I get in Linux if command not found). I also get this same error when I run only adb logcat from my terminal as non-root user while booted into TWRP.
I can't figure out how to boot into my system. I can't figure out how to give better logs either. For now I will shut down my phone, any assistance appreciated.
Despite following the link given in the comments, my issue still persists exactly as it did before. Hence the link wasn't of much help in this case.
PS: I would appreciate it if you could also give me feedback on the quality of my question and how I may improve it.
adbcommand/argument and works only when usb-debugging is enabled (local.prop) – alecxs May 27 '21 at 15:44