When an Android phone refuses to boot – stuck on the logo, looping in recovery, or showing a fastboot prompt – the device is often called “bricked”. Most users think the only solution is to send the phone to a service centre, but in many cases you can bring it back to life yourself using the fastboot and adb tools. This tutorial walks you through the entire process, from preparing your computer to flashing a clean stock image, while explaining why each step matters.
ADB (Android Debug Bridge) and Fastboot are command‑line utilities that let you communicate with Android devices over USB. They are bundled in the Android SDK Platform‑Tools package.
C:\adb on Windows or ~/adb on macOS/Linux.PATH (optional but convenient). On Windows, open System Properties → Advanced → Environment Variables → Path → New, then paste the folder path.adb version
fastboot version
You should see version numbers without errors.The exact key combination varies by manufacturer. Below are the most common methods:
Power + Volume Down until the fastboot screen appears.Volume Down + Bixby + Power (or Volume Down + Power on newer models) and select Download mode, then press Volume Up to confirm.Power + Volume Up (or Volume Down for some models) until fastboot shows.When the screen displays a text‑only interface with the Android robot and the word “FASTBOOT”, you are ready.
fastboot devices
If you see a device ID (e.g., 0123456789abcdef fastboot), the connection works. If the list is empty:
Many devices ship with a locked bootloader, which prevents flashing any image other than the signed OTA. Unlocking wipes user data, so this step is a final “reset”. Not all manufacturers allow unlocking (e.g., some carrier‑locked Samsung devices). Check the OEM’s policy before proceeding.
fastboot flashing unlock
The device will show a confirmation screen; use the volume keys to select “Yes” and confirm with the power button.Stock firmware is a complete system image that restores the phone to the state it left the factory. Sources:
Make sure to match:
marlin for Pixel XL).US, EU, Verizon).After downloading, extract the zip. You should see a set of .img files (boot, system, vendor, etc.) and a flash-all.sh (Linux/macOS) or flash-all.bat (Windows) script.
There are two approaches: use the provided script (simplest) or flash each partition manually (more control). We cover both.
# Windows example
cd C:\downloads\pixel_xl_factory_image
# macOS/Linux example
cd ~/Downloads/pixel_xl_factory_image
# Windows
flash-all.bat
# macOS/Linux (make script executable first)
chmod +x flash-all.sh
./flash-all.sh
bootloader, radio, system, vendor, and other partitions in the correct order. Do not interrupt.Manual flashing is useful when you need to skip a partition (e.g., keep a custom recovery) or when the script fails.
# Example for flashing system and boot only
fastboot flash boot boot.img
fastboot flash system system.img
fastboot flash vendor vendor.img
# Add other partitions as needed
fastboot reboot
After each fastboot flash command, fastboot will report “OKAY”. If you see “FAIL”, note the error message – it often indicates a mismatched image or a locked partition.
When the phone boots for the first time after flashing, it may take longer than usual (initializing apps, restoring defaults). Verify:
If the device still refuses to boot, proceed to the troubleshooting section.
.sha256 file).# /etc/udev/rules.d/51-android.rules
SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
Then run sudo udevadm control --reload-rules && sudo udevadm trigger.
sam-unlock for some Samsung models) or consider using Download mode with Odin (Samsung) to flash stock firmware without unlocking.userdata partition or leftover custom recovery.fastboot erase userdata
fastboot erase cache
fastboot reboot
Then re‑run the flash‑all script.
If you unlocked the bootloader solely to flash stock firmware, you can re‑lock it to restore the original security posture.
fastboot flashing lock
The device will wipe user data again, then reboot. After re‑locking, the phone behaves like a fresh out‑of‑the‑box device.
Settings → System → Advanced → Reset options → Reset Wi‑Fi, mobile & Bluetooth to clear any leftover network configs.Settings → Battery → Battery usage and verify no abnormal drain.If you have tried the steps above and the device still does not enter fastboot, shows hardware error codes, or the screen remains black, the problem may be hardware‑related (e.g., faulty eMMC, damaged boot ROM). At that point, a qualified repair shop is the safest option.
Unbricking an Android phone with Fastboot and ADB is a systematic process: prepare the PC, get the correct stock firmware, unlock the bootloader (if needed), flash the partitions, and verify the result. By understanding why each command is required, you reduce the risk of further damage and gain confidence to troubleshoot future software issues. Keep the backup of stock images for your device – they are the most reliable safety net when something goes wrong.









