Android firmware via USB cable is one of the most reliable ways to update or restore the system when standard methods do not work. This process requires care, but with the right approach it can solve most software problems: from freezes and errors to completely bricking the device. Unlike over-the-air updates (OTA), firmware via USB gives the user full control over the software version, the ability to roll back or install custom assemblies.

However, not all firmware is the same: official (stock firmware) from the manufacturer, custom (custom ROM) like LineageOS or Pixel Experience, as well as modified kernels require different approaches. In this article we will look all stages from preparing the device to solving common errors, so that even a beginner can safely flash his smartphone. We will pay special attention to firmware via Fastboot and ADB Sideload modes, as they cover 90% of cases of restoring Android devices.

1. Preparing the device: what needs to be done before flashing

Before connecting your smartphone to your computer, you need to complete several critical steps. Neglecting them can lead to data loss, "brick" (inoperability) of the device or even physical damage to the hardware.

Firstly, create a backup copy all important data. Firmware almost always erases internal memory, and restoring information after it is an extremely difficult task. Use cloud services (Google Drive, Dropbox) or local copying to your PC. Please note: some custom firmware requires unlocking the bootloaderwhich automatically formats the device.

  • ๐Ÿ“ฑ Battery charge level - at least 60%. Firmware may be interrupted when the battery is low, leaving the phone inoperable.
  • ๐Ÿ”Œ Original USB cable. Cheap cables often do not support data transfer, only charging.
  • ๐Ÿ–ฅ๏ธ Computer with Windows/Linux/macOS. On Windows you will need drivers ADB and Fastboot.
  • ๐Ÿ”“ OEM unlocking (in the developer settings). Without this, firmware via Fastboot will not be possible.

The second key point is checking the device model. Firmware from another model (even from the same line) can make the phone inoperable. You can find out the exact model in the settings (Settings โ†’ About phone โ†’ Model) or through the command adb shell getprop ro.product.model. For devices Samsung, Xiaomi and OnePlus it is also important to take into account the region (for example, Redmi Note 10 Pro for India and the global version have different firmware).

โš ๏ธ Attention: On devices with Exynos (for example, Samsung Galaxy S22), unlocking the bootloader resets the data including internal memory, even if the firmware does not erase user partitions. On Snapdragonversions this does not happen.

2. Selection of firmware: official vs custom

Not only the functionality of the device, but also the method of its installation depends on the type of firmware. Let's consider the main options:

Firmware type Advantages Disadvantages Installation method
Official (Stock) Stability, support for OTA updates, warranty Limited settings, blockware (pre-installed applications) Fastboot, Odin (for Samsung), Mi Flash (for Xiaomi)
Custom (Custom ROM) More functions, updates after the end of official support Possible bugs, loss of some functions (for example, Widevine L1) TWRP + ADB Sideload or Fastboot
Modified (Magisk, Kernel) Root access, fine-tuning performance Risk of security breach, problems with banking applications Fastboot (patched boot.img) or TWRP

For most users, the optimal choice is official firmware the latest version. It can be downloaded from the manufacturers' websites:

If you decide to install custom firmware, pay attention to the forums XDA Developers and 4PDA. Popular projects:

  • ๐Ÿ“ฒ LineageOS โ€”pure Android without bloatware, long-term support.
  • ๐ŸŽจ Pixel Experience โ€”interface and functions from Google Pixel.
  • โšก ArrowOS โ€”balance between performance and customization.
โš ๏ธ Attention: Marked firmware GSI (Generic System Image) are universal, but may not support camera, NFC, or mobile connectivity on your device. Before installation, check the compatibility list at XDA.
๐Ÿ“Š Which firmware do you prefer?
Official (Stock)
Custom (LineageOS, Pixel Experience)
Modified (Magisk, Kernel)
I donโ€™t know, havenโ€™t tried it yet

3. Installing the necessary tools on a PC

For firmware via USB you will need minimum set of appswhich varies depending on the method. Below is a universal list for most scenarios:

  1. ADB and Fastboot:
    • ๐Ÿช› Windows: Download Platform Tools from Google (archive platform-tools.zip). Unpack to the root of the disk C:\ for convenience.
    • ๐Ÿง Linux/macOS: Install via package manager:
      sudo apt install adb fastboot  # Debian/Ubuntu
      

      brew install android-platform-tools # macOS

  2. Drivers:
    • ๐Ÿ–ฅ๏ธ For Windows download USB drivers or use Zadig to install libusb.
    • ๐Ÿ“ฑ For Samsung additional drivers are needed Samsung USB Driver.
  • Branded utilities (if necessary):
    • ๐Ÿ”ง Odin โ€”for flashing devices Samsung.
    • ๐Ÿ“ฒ Mi Flash Tool โ€”for Xiaomi.
    • ๐Ÿค– QFil โ€”for Qualcommdevices (for example, OnePlus, LG).

    After installing the tools, check their functionality. Connect your phone in Fastboot mode (how to do this - see the next section) and run on the command line:

    fastboot devices

    If the device is displayed (for example, 1234abcd fastboot), then the drivers are installed correctly. If not, reinstall them or try another USB port (preferably USB 2.0).

    โ˜‘๏ธ Preparing the PC for firmware

    Done: 0 / 4

    4. Entering Fastboot and Recovery modes: step-by-step guide

    Flashing via USB is impossible without switching the device to a special mode:

    • ๐Ÿ”ง Fastboot โ€” for installing official firmware, unlocking the bootloader, flashing the kernel.
    • ๐Ÿ› ๏ธ Recovery (TWRP/Stock) โ€” for installing custom firmware via ADB Sideload or ZIP files.

    How to enter Fastboot:

    1. Turn off device.
    2. Hold down the combination of buttons (depending on the manufacturer):
      • ๐Ÿ“ฑ Samsung: Volume down + Power + Bixby (hold for 10 seconds).
      • ๐Ÿค– Google Pixel/OnePlus: Volume down + Power.
      • ๐ŸŽ Xiaomi/Redmi: Volume down + Power (on some models you must first hold down Volume up + Power, then select Fastboot in the menu).
  • Connect USB cable to PC. The device screen should show the message Fastboot Mode.
  • How to enter Recovery:

    1. Turn off the device.
    2. Hold:
      • ๐Ÿ“ฑ Samsung: Volume up + Power + Bixby (release when the logo appears).
      • ๐Ÿค– Google Pixel: Volume down + Power, then select Recovery Mode volume buttons.
      • ๐ŸŽ Xiaomi: Volume up + Power (hold until Mi Recovery).
  • B Stock Recovery select Apply update from ADB for firmware via ADB Sideload.
  • If lock or a request to confirm bootloader unlocking appears on the screen, it means the device is not unlocked. For Xiaomi i Google Pixel this is done through the command:

    fastboot flashing unlock

    On Samsung unlocking the bootloader is officially impossible without activating the mode OEM Unlock v developer settings (before flashing!).

    What to do if the device is not included in Fastboot?

    If the button combination does not work, try:

    1. Connect the charger for 5 minutes, then try again.

    2. Use another USB cable (the contact may be damaged).

    3. For Samsung with a processor Exynos a special cable may be required USB Jig (for example, to exit Download Mode).

    4. If the screen is black, but the PC detects the device as Qualcomm HS-USB QDLoader 9008, then the smartphone is in mode EDL (emergency firmware).

    5. Firmware via Fastboot: universal method

    Method Fastboot is suitable for most devices based on Qualcomm Snapdragon, MediaTek i Google Tensor. It allows you to flash both official and custom images (if they are presented in the format .img).

    Step-by-step guide:

    1. Unpack the downloaded firmware into a folder with platform-tools (for example, C:\platform-tools\).
    2. Open the command line in this folder (Shift + RMB โ†’ Open command window).
    3. Connect the device in mode Fastboot (see previous section).
    4. Check the connection:
      fastboot devices

      The serial number should be displayed devices.

    5. For flashing the official image (for example, Google Pixel) use the script flash-all.bat (Windows) or flash-all.sh (Linux/macOS):
      flash-all.bat

      For manual firmware, run the commands one by one (example for Xiaomi):

      fastboot flash boot boot.img
      

      fastboot flash system system.img

      fastboot flash vendor vendor.img

      fastboot flash dtbo dtbo.img

      fastboot reboot

    For devices Samsung instead Fastboot the utility is used Odin:

    1. Download Odin (version 3.14.4 is recommended for new models).
    2. Extract the firmware (file with extension .tar.md5).
    3. Run Odin, connect the phone in the mode Download Mode (analogue Fastboot for Samsung).
    4. In Odin click AP and select the firmware file (BL, CP, CSC) will be filled in automatically.
    5. Press Start and wait for completion (do not disconnect USB!).
    โš ๏ธ Attention: On some devices Xiaomi (for example, Redmi Note 10 Pro) firmware via Fastboot requires Mi account authorization. If an error appears Mi Account Lock, you need to link the device to the account in Mi Unlock Tool in advance.
    fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

    This will disable the system integrity check and allow you to flash modified images.-->

    6. Firmware via ADB Sideload (for custom firmware)

    Method ADB Sideload is used to install firmware in the format .zip via Stock Recovery or TWRP. It is suitable for custom ROMs and updates when it is not possible to flash via Fastboot.

    Instructions:

    1. Download the firmware in the format .zip (for example, LineageOS).
    2. Transfer the device to Recovery Mode (see section 4).
    3. In the recovery menu, select Apply update โ†’ Apply from ADB (for Stock Recovery) or Advanced โ†’ ADB Sideload (for TWRP).
    4. Connect the device to the PC and run the command:
      adb sideload file_name.zip

      Example:

      adb sideload lineage-20.0-20231201-nightly-redfin-signed.zip
    5. Wait for completion (progress is displayed on the device screen).
    6. After installation select Reboot system now.

    For TWRP you can also flash the ZIP file directly from the memory card:

    1. Copy the firmware to SD-card or internal memory.
    2. To TWRP select Install โ†’ specify the path to the file.
    3. Swipe to confirm the firmware.

    If after flashing a custom ROM the device is stuck on the logo, perform cleaning cache:

    1. Log in Recovery.
    2. Select Wipe โ†’ Format Data (careful! This will delete all data).
    3. Reboot.
    ๐Ÿ’ก

    ADB Sideload does not work in Stock Recovery of some manufacturers (for example, Huawei and Oppo). In this case, you will need to first install TWRP via Fastboot.

    7. Typical errors and their solutions

    Even if you follow the instructions exactly, errors may occur. Below are the most common problems and ways to fix them:

    Error Cause Solution
    device not found (in ADB/Fastboot) Missing drivers or USB port faulty Reinstall the drivers, try the port USB 2.0, disable the antivirus
    failed to allocate size (in Fastboot) Insufficient memory on the device or the image is damaged Check integrity firmware file (MD5), free up space on the phone
    Signature verification failed (in Recovery) The firmware is not signed for your device Disable signature verification in TWRP (Settings โ†’ Disable signature verification)
    Mi Flash: Flash is done, but device stuck on logo Incompatible firmware version or locked bootloader Check the firmware version (for example, Global vs China), unlock the bootloader
    Odin: FAIL! (Auth) Samsung blocks unofficial firmware files Use the official firmware for your model and region

    If the device after flashing does not turn on or stuck on the logo:

    1. Try logging in in Recovery and do Wipe Data.
    2. If that doesnโ€™t help, flash full image (not only system, but also boot, vendor, dtbo).
    3. For MediaTekdevices may require firmware via SP Flash Tool in Firmware Upgrade.
    4. If Odin or Mi Flash gives an error N/A at any stage, this often means that the firmware file damaged. Check its checksum (MD5 or SHA256) using the utility 7-Zip or HashMyFiles.

      How to restore IMEI after flashing?

      If IMEI is lost after flashing (no network), try:

      1. Restore the backup copy of the partition nvram or persist (if you made a backup in TWRP).

      2. For MediaTek use Maui META or SN Writer Tool.

      3. For Qualcomm โ€” QCN Rebuilder or QPST.

      โš ๏ธ IMEI recovery may be illegal in some countries. Use only for your device!

      8. data-i="333">Successful firmware is only half the battle. After turning on the device for the first time, you need to perform several steps to ensure stable operation:

      Successful firmware is only half the battle. After turning on the device for the first time, you need to perform several steps to ensure stable operation:

      • โš™๏ธ System setup:
        • Go through the initial setup (select a language, connect to Wi-Fi).
        • Update Google Play Services and other system applications.
        • If you flashed a custom ROM, install GApps (Google services package) via TWRP.
      • ๐Ÿ”„ Checking for updates:
        • For official firmware, check Settings โ†’ System update.
        • For custom ROMs, updates are installed via Settings โ†’ System Updates or manually via TWRP.
      • ๐Ÿ“ฑ Data recovery:
        • If you made a backup via TWRP, restore it (Restore).
        • For cloud backups (Google Drive) log in to your account and synchronize the data.
      • ๐Ÿ”’ Security:
        • If you flashed a custom ROM, install Magisk to control root access.
        • Check the status SafetyNet (for example, through the app SafetyNet Test). If ctsProfile: false, banking applications may not work.

      If after the firmware you noticed problems with performance (lags, overheating), try:

      • ๐Ÿ”„ Reset settings to factory settings (Settings โ†’ System โ†’ Reset).
      • ๐Ÿ“‰ Disable animations in the developer settings (Window animation scale โ†’ 0.5x).
      • ๐Ÿ”‹ Calibrate the battery: completely discharge, then charge to 100% without interruption.

      For devices with AMOLED screens after the firmware may be observed image burn-in (for example, residual traces from old icons). To reduce the effect, enable the function Adaptive backlight or use applications like Screen Burn-In Fixer.

      โš ๏ธ Attention: On some custom firmware (for example, LineageOS without GApps) Google services do not work, including Play Market. To fix this, flash the package Open GApps (choose option pico or nano to save space).

      FAQ: Frequently asked questions about Android firmware via USB

      โ“ Is it possible to flash a phone without unlocking the bootloader?

      No, for most modern devices (except for some Samsung i Huaweiunlocking the bootloader is required. The exception is official updates via Odin or Mi Flash without changing the Android version. However, even in this case, some manufacturers (for example Xiaomi) require account linking.

      โ“ Why does flashing firmware via Fastboot take so long?

      Speed depends on:

      • ๐Ÿ–ฅ๏ธ PC performance (read/write speed is especially important disk).
      • ๐Ÿ”Œ USB port version (USB 3.0 is faster, but sometimes unstable for Fastboot).
      • ๐Ÿ“ฑ Firmware size (full images weigh 2โ€“4 GB).

      If the process is stuck at one stage for more than 10 minutes, check:

      • Integrity of the firmware file (download and compare again MD5).
      • USB connection (try a different cable/port).
      • Availability of free space on the device (minimum 500 MB on the system partition).
    โ“ How to return official firmware after custom?

    To return to the official firmware:

    1. Download full image (not OTA update) for your model from the official website.
    2. Flash it through Fastboot (for Google Pixel, OnePlus) or Odin/Mi Flash (for Samsung/Xiaomi).
    3. If the bootloader has been unlocked, you can lock it again with the command:
      fastboot flashing lock

      โš ๏ธ This will erase all data and may cause a crash if the firmware is unofficial.

    For Samsung after flashing the official ROM through Odin may work Knox, which will lead to loss of warranty and inability to use Samsung Pay.

    โ“ Is it possible to flash a phone with a broken screen?