My Android phone does not start - how to isolate hardware issue? I use Moto G6 ALI with a custom ROM Pixel Experience running Android 11. So far so good and I was using this setup for almost two weeks as my daily use phone.
Today suddenly the phone froze when opening Whatsapp. No further response on the screen was observed. I had to restart the phone by pressing the power button for more than 5 seconds. Since I have unlocked by bootloader several years ago, I saw the boot locker unlocked warning. This usually stays for 5 seconds and then after I usually the boot animation.  But this time there is no movement beyond the unlock warning.
I had flashed TWRP recovery and tried booting with it by pressing Vol-Down+Power button and then choosing &quot;Recovery&quot;.  The phone started the recovery mode but stuck with TWRP logo.
I then restarted to bootloader and gave the command &quot;fastboot devices&quot; and my device was recognised. So I downloaded the 64bit version of the recovery image and temporarily booted with the command &quot;fastboot boot mali.img&quot;.  This too stuck at the same point.  Any clues on how to go ahead?
If your device received update recently which was already scheduled waiting on reboot, the instruction is placed in /cache/recovery/command TWRP may stuck on that instruction. this can be cleared by formatting cache partition
TWRP Commandline Guide
If device stuck on TWRP splash screen you still might have command line access via adb. Note daemon has 30 second delay on start, adbd is not ready when TWRP is boot-looping
adb shell format cache

or manually if partition is not in fstab
adb shell
find /dev/block -name by-name
mke2fs /dev/block/bootdevice/by-name/cache

If bootloader is unlocked you can also format from fastboot
fastboot format:ext4 cache


For further analyzing boot-loop usb-debugging is required. On unlocked device you can enable by modifying default.prop

download ROM according to your version
unpack boot.img and extract with AIK
modify ramdisk/default.prop and repack
flash image-new.img into boot partition

(you can read how it works here)
Why &quot;adb root&quot; does nothing?
  ro.adb.secure=0
  ro.secure=0
  ro.debuggable=1
  persist.service.adb.enable=1
  persist.service.debuggable=1
  persist.sys.usb.config=mtp,adb


If your device is booting far enough you should be able to capture some log during boot. For details and more information on debugging refer to the logcat wiki
Reading and Writing Logs