Fastboot / ADB Flash – How to Flash Firmware via Fastboot
Learn how to flash Android firmware using Fastboot and ADB. This guide covers unlocking the bootloader, flashing individual partitions or full factory images, A/B slot handling, and troubleshooting detection and command errors — works on Pixel, Xiaomi, OnePlus, Motorola, and more.
Pre-Flight Checklist
Complete ALL items before proceeding. Skipping any step increases the risk of bricking your device.
Guide 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:
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:
- Enable Developer Options: Settings → About Phone → tap Build Number 7 times
- Go to Settings → Developer Options → enable OEM Unlocking
- Connect device to PC, open terminal:
Once in bootloader/fastboot mode:
Confirm the unlock on your device screen using the volume keys and power button. This will factory reset your device.
Method 1 — via ADB (recommended, device must be on):
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:
You should see your device serial number. If nothing shows, reinstall drivers.
Option A: Flash a single .img file
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:
Option C: Wipe data partition manually
After flashing, reboot:
Or to reboot into recovery:
The first boot will take several minutes. Do not panic if it takes up to 10 minutes — Android is optimizing apps.
Congratulations! Flash Successful!
You've successfully completed all steps. Your device should now be running the new firmware. If it's booting normally — you're done! Check the troubleshooting section below if you encounter any issues.
Troubleshooting & FAQ
Common errors and their solutions. Read this before asking for help.
Most common causes:
- Wrong driver — install Google USB Driver or your device's specific ADB driver
- Device isn't actually in fastboot mode — verify screen shows "Fastboot Mode" or "Bootloader"
- Bad USB cable — try the original cable
- 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:
Or use:
The factory image flash-all script handles this automatically.
Yes, on most devices:
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.
Prioritize our guides in your Google search results.
No comments yet. Be the first to share your experience with this guide!