Android

Flashing Stock Android Firmware: Step-by-Step System Recovery

Guide to safely installing factory firmware on Android smartphones and tablets. You'll get a clean, unmodified system and resolve update issues.

Updated at April 6, 2026
30-45 min
Medium
FixPedia Team
Применимо к:Android 10–15Pixel, OnePlus, Xiaomi, SamsungDevices with unlocked bootloader

Why Flash Stock Firmware

Returning to stock firmware resolves issues caused by unstable custom builds, completely removes root privileges, and restores official over-the-air updates. After completing this guide, you will have a clean, secure system ready for resale or long-term use, free from any traces of third-party modifications.

Requirements and Preparation

Before you begin, ensure you have an original USB cable, a stable internet connection, and a computer running Windows, macOS, or Linux. The battery charge should be above 60%. Always back up your contacts, photos, and documents. The installation process will completely erase user data and applications.

⚠️ Important: A mismatch between the firmware's model number or region and the actual device will cause the bootloader to refuse loading. Always verify the information on the sticker under the back cover or in Settings → About phone.

Step 1: Prepare Tools and Unlock Bootloader

Install the official platform-tools package from Google and add its path to your system variables. On your smartphone, enable "Developer Options" (tap "Build number" 7 times), then turn on USB debugging and OEM unlocking in the advanced settings.

adb devices

This command lists connected devices. If the status shows unauthorized, confirm the prompt on your smartphone's screen.

Step 2: Download the Correct Image

Only download firmware from trusted sources: official manufacturer portals, XDA repositories, or verified mirrors. The file should be in .zip or .tar.md5 format. Extract the archive into a separate folder without spaces in the name to avoid path errors in the command line.

Step 3: Boot into Fastboot/Download Mode

For most devices (Pixel, Xiaomi, OnePlus), use this terminal command:

adb reboot bootloader

The phone will reboot into the Fastboot interface. For Samsung devices, enter Download Mode by holding Volume Down + Bixby/Home + Power. Connect the phone to your PC and verify the connection:

fastboot devices

The output should contain the serial number and device status. An empty output indicates a driver or cable issue.

Step 4: Flash Stock Firmware

Modern images include a ready-made batch script for automatic flashing. On Windows, run flash-all.bat; on macOS/Linux, run flash-all.sh from the extracted folder. The script will automatically wipe partitions, flash boot, system, vendor, and initiate a reboot.

If the script is missing, flash the partitions manually:

fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash vendor vendor.img
fastboot -w
fastboot reboot

The -w flag forcibly formats userdata and cache. Wait for the process to complete without disconnecting the cable or pressing the power button.

Verify the Result

The first boot takes 5–15 minutes due to app optimization. After the welcome screen appears, complete the initial setup. Open Settings → About phone → Software information and compare the build number with the official release on the manufacturer's website. Ensure mobile networks, Wi-Fi, Bluetooth, and the camera work correctly. The updates section should show the latest security patch available.

Potential Issues

  • < waiting for any device >: Install the universal Google USB Driver. Try a different USB port (preferably USB 3.0) or an original cable.
  • FAILED (remote: partition does not exist): The image does not match the device's processor architecture or bootloader version. Abort the process and download the exact version for your specific SKU.
  • Stuck on logo: Hold Volume Up + Power to enter Recovery, then select Wipe data/factory reset. If the problem persists, reflash the device with the -w flag or run fastboot erase userdata.
  • Samsung and SW REV CHECK FAIL error: The anti-rollback protection has triggered. You are attempting to install firmware with a lower index than the current one. Downgrading is impossible in this case—only use releases with an equal or higher index.

F.A.Q.

Will my data be erased during flashing?
Can I downgrade to an older Android version?
What to do if the device is stuck on the logo after flashing?

Hints

Preparing drivers and backup
Downloading the correct image
Entering Fastboot/Download mode
Flashing the image to memory
First boot and verification

Did this article help you solve the problem?

FixPedia

Free encyclopedia for fixing errors. Step-by-step guides for Windows, Linux, macOS and more.

© 2026 FixPedia. All materials are available for free.

Made with for the community