When an Android phone restarts over and over without reaching the lock screen, you’re dealing with a boot loop. The symptom is usually caused by a corrupted system partition, a failed OTA update, or a mismatched custom ROM. The good news is that, as long as the bootloader still accepts commands, you can break the loop using the standard Android debugging tools – adb and fastboot. This tutorial walks you through a safe, repeatable process that works on most manufacturers (Pixel, OnePlus, Samsung, etc.) while keeping data loss to a minimum.
adb and fastboot)..tgz that matches your exact model and Android version.adb pull /sdcard/. If not, consider a fastboot oem unlock (which wipes everything) only as a last resort.adb or fastboot.Connect the phone to the PC with a good USB‑C cable. Open a terminal (Command Prompt, PowerShell, or a Linux shell) and run:
adb devices
If the output shows a device serial number with the word device, you can use ADB commands. If it shows unauthorized or nothing at all, try the following:
If ADB still fails, you can skip directly to fastboot mode – most devices expose fastboot even when the OS is dead.
Even a partial backup can save photos, documents, or app data. Use the following commands as needed:
# Pull the entire internal storage (may take a while)
adb pull /sdcard/ ~/AndroidBackup/
If the phone only boots into recovery, you can still use adb pull from there, provided the recovery image supports it (e.g., TWRP). If you cannot access adb at all, accept that data may be lost.
There are three common ways to reach fastboot:
adb reboot bootloaderWhen the screen shows a minimalist bootloader UI (often a gray or black screen with the device model), you’re ready.
The exact flashing commands differ by manufacturer. Below are two generic approaches that cover the majority of devices.
boot.img, system.img, vendor.img, etc.fastboot devices
bootloader (if present), then radio, boot, system, and finally vendor.
# Example sequence
default_fastboot() {
fastboot flash bootloader bootloader.img || exit 1
fastboot reboot-bootloader
fastboot flash radio radio.img || exit 1
fastboot reboot-bootloader
fastboot flash boot boot.img || exit 1
fastboot flash system system.img || exit 1
fastboot flash vendor vendor.img || exit 1
fastboot erase userdata # optional, clears corrupted user data
fastboot reboot
}
default_fastboot
Adjust the file names to match those in your package.
OKAY if successful.Some OEMs do not expose raw images via fastboot. Instead, they provide a flashable ZIP that must be sideloaded from recovery:
adb sideload path/to/stock_update.zip
The recovery will unpack and install the firmware.
If the device refuses to enter recovery, you may need to use the OEM’s desktop flashing utility (e.g., Odin for Samsung). Those tools are outside the scope of this tutorial but follow the same principle: flash the official stock image.
After the flash finishes, the phone should reboot into the Android setup wizard. If you see the lock screen or home screen, the boot loop is resolved.
To double‑check that the system partitions are clean, you can run:
adb shell getprop ro.bootmode
It should return normal. You can also confirm the Android version matches the firmware you flashed:
adb shell getprop ro.build.version.release
android-sdk/platform-tools for Linux/macOS).FAILED (remote: ...)pixel_4a vs pixel_4a_5g).fastboot erase userdata
Some OEMs lock the bootloader permanently (e.g., certain carrier‑branded Samsung models). In those cases you can try:
Odin, LG’s LG Flash Tool, or Huawei’s HiSuite. These utilities accept the same stock images but use a proprietary protocol.Both methods still require the correct firmware for your exact model and region.
By following this structured workflow, you can turn a frustrating boot loop into a clean, functional Android system without resorting to costly repairs. Remember that flashing always carries risk; proceed carefully, and when in doubt, consult the device’s official support channels.









