📱 Flashing Guides

How to Flash Android Firmware Using Fastboot and ADB

Fastboot and ADB are the universal tools for Android firmware flashing, bootloader unlocking, and partition management — built directly into Android Platform Tools by Google. This guide covers setup, device connection, bootloader unlock, and flashing firmware on any Android device.

Difficulty: 🔴 Advanced
Read time: 26 min
Updated: May 13, 2026
Tool Version: v37.0.0
High Risk — backup first!
🪟 Windows 🍎 macOS 🐧 Linux

Pre-Flight Checklist

Complete ALL items before proceeding. Skipping any step increases the risk of bricking your device.

Requirements met 0 / 7

Guide Steps

Guide Progress
0/5 steps

Download Android Platform Tools from Google and extract to a folder. Open a Command Prompt (Windows) or Terminal (Mac/Linux) in that folder and test:

adb --version fastboot --version

Both commands should return a version number. If you get "command not found", add the Platform Tools folder to your system PATH environment variable.

If your bootloader is not already unlocked:

  1. Enable Developer Options: Settings → About Phone → tap Build Number 7 times
  2. Go to Settings → Developer Options → enable OEM Unlocking
  3. Connect device to PC, open terminal:
adb reboot bootloader

Once in bootloader/fastboot mode:

fastboot flashing unlock

Confirm the unlock on your device screen using the volume keys and power button. This will factory reset your device.

🚫 Unlocking the bootloader voids your warranty on most devices and permanently trips the Knox counter on Samsung devices.

Method 1 — via ADB (recommended, device must be on):

adb reboot bootloader

Method 2 — via hardware buttons (device must be OFF):

  • Google Pixel: Power + Volume Down
  • OnePlus: Power + Volume Up
  • Xiaomi/Redmi: Power + Volume Down
  • Motorola: Power + Volume Down

Verify your PC recognizes the device in fastboot mode:

fastboot devices

You should see your device serial number. If nothing shows, reinstall drivers.

Option A: Flash a single .img file

fastboot flash boot boot.img fastboot flash recovery recovery.img fastboot flash system system.img

Option B: Flash Google Pixel factory image (full wipe)

Extract the factory image ZIP. Inside you'll find a flash-all.sh (Mac/Linux) or flash-all.bat (Windows). Run it:

# Windows: flash-all.bat # Mac/Linux: ./flash-all.sh

Option C: Wipe data partition manually

fastboot erase userdata fastboot erase cache
⚠️ Erasing userdata is IRREVERSIBLE. All your files, apps, and settings will be permanently deleted.

After flashing, reboot:

fastboot reboot

Or to reboot into recovery:

fastboot reboot recovery

The first boot will take several minutes. Do not panic if it takes up to 10 minutes — Android is optimizing apps.

💡 After unlocking the bootloader, you may see a warning screen on every boot ("your device is unlocked"). This is normal and can't be removed without re-locking the bootloader.

Troubleshooting & FAQ

Common errors and their solutions. Read this before asking for help.

Most common causes:

  1. Wrong driver — install Google USB Driver or your device's specific ADB driver
  2. Device isn't actually in fastboot mode — verify screen shows "Fastboot Mode" or "Bootloader"
  3. Bad USB cable — try the original cable
  4. On Windows: run Command Prompt as Administrator

This means fastboot is connected but doesn't recognize the command. Possible causes:

  • You're not actually in fastboot mode (you might be in recovery or ADB mode instead)
  • Using an older fastboot version — update Android Platform Tools
  • The partition name is wrong for your device (e.g., some use "boot_a" and "boot_b" for A/B partition schemes)

Modern devices (Pixel 2+, most flagships 2019+) use A/B partition scheme. To flash both slots:

fastboot flash --slot=all boot boot.img

Or use:

fastboot flash boot_a boot.img fastboot flash boot_b boot.img

The factory image flash-all script handles this automatically.

Yes, on most devices:

fastboot flashing lock

However, you must flash official stock firmware before re-locking. Re-locking with custom software will hard brick your device. The device will factory reset again on lock.

Never miss a fix.

Prioritize our guides in your Google search results.

Set as Preferred

No comments yet. Be the first to share your experience with this guide!

Leave a Comment —

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.