Reflashing the Xiaomi smartphone through ADB (Android Debug Bridge is a powerful tool for power users to update the system, install custom software or restore the device. β The phone, the method using fastboot and ADB It gives you complete control of the process, but requires care: one wrong step can turn your Redmi or your Redmi into a real life. POCO This article covers all the steps from unlocking the bootloader to installing the firmware, with an emphasis on the features of working with the software. MIUI 14/15 and new models 2023β2026 year-end.
Why ADB? This is indispensable when: official updates are not available for your model, you need to roll back on the old version of MIUI, or you want to install LineageOS/Pixel Experience. We will analyze two scenarios: firmware through fastboot (for official and custom firmware) and ADB sideload (for updates without losing data).
1.Preparation: What you need to Firmware through ADB
Before you start, make sure you have everything you need, and firmware through ADB requires more preparation than a standard over-the-air update.
- π± Xiaomi smartphone with a battery charge of at least 60% (the risk of disconnection during the process negates efforts).
- π» Computer running Windows 10/11, macOS or Linux (Macs require homebrew for drivers).
- π Cable USB Type-C (preferably original β cheap cables can interrupt the connection).
- π Unlocked bootloader (more on this in the next section).
- π Firmware in.tgz (official) or.zip (castom) format for your model.
For official versions of MIUI, download files only from the official Xiaomi website (Download β Select device section). Look for firmware (for example, ArrowOS or HavocOS) on the XDA Developers or 4PDA forums, but check user reviews - some builds may contain bugs with a Wi-Fi or NFC module.
β οΈ Attention: Firmware through ADB Xiaomi models 12T, 13 Pro and later requires authorization of the Mi Account even after unlocking the bootloader. If you forget the password, restore access in advance, otherwise the device will be blocked after flashing.
2. Unlocking the bootloader: step zero
Without the bootloader, firmware through ADB is not possible. Xiaomi blocks it by default to protect against unauthorized changes. The unlocking process takes 3 to 7 days (due to account verification) and involves the following steps:
- Link the device to your Mi Account in settings (Settings β Xiaomi Account).
- Activate Developer Mode: Go to Settings β About Phone and click on MIUI Version 7 times.
- Enable USB Debugging and OEM Unlocking in Settings β More β For Developers.
- Install the Mi Unlock Tool on your PC and log in under the same Mi Account.
- Connect your phone in fastboot mode (click Volume Down + Power) and follow the program instructions.
An important nuance: since 2023, Xiaomi has tightened the rules, and now you need to unlock:
- π± The device must be tied to the account for at least 7 days (previously 72 hours were enough).
- π Mi Account must have a confirmed phone number and email.
- π The account region must be the same as the firmware region (for example, for MIUI Global needs an account with the Global regionΒ»).
β οΈ Warning: Once the bootloader is unlocked, the smartphone will perform a full reset (wipe). save data in advance on the PC or in the cloud. Also, some banking applications (for example, SberBank Online) may stop working due to the SafetyNet trigger.
What if the Mi Unlock Tool gives you a "Couldn't unlock" error?
3. Install ADB and Fastboot on PC
To work with ADB and fastboot, the computer must have the appropriate drivers and utilities installed, and the most reliable way is to use Googleβs Platform Tools:
- Download Platform Tools for your OS (~50MB size).
- Unpack the archive to the root of the C:\ disk (e.g., C:\platform-tools\).
- Open the Command Prompt (Win + R β cmd) and go to the folder: cd C:\platform-tools\
- Connect the phone in fastboot mode and check the connection with the command: fastboot devices If the device is determined (the serial number will appear), the drivers are installed correctly.
Windows may require manual installation of Android Bootloader Interface drivers.If the fastboot device command returns a blank list:
- π§ Open Device Manager (Win) + X β Device Manager).
- π Find a device with a yellow exclamation point (usually in the Other Devices section).
- π₯ Right-click. β Update the driver β Search on this computer and point the path to the platform-tools folder.
π‘
If the adb device command doesn't show the device, try switching USB mode on your phone from Charging to File Transfer (MTP) and back again. Sometimes this resets the connection.
4. Firmware through Fastboot: step-by-step instructions
This method is suitable for installing official MIUI firmware (.tgz format) and some custom firmware (for example, Xiaomi.eu). It completely erases the data on the device, so pre-execute backup.
Algorithm of action:
βοΈ Preparation for firmware through fastboot
- Unpack the downloaded firmware (for example, miui_BLOCKNAME_Global_V14.0.1.0.TKWMIXM_1234567890_12.0.tgz) It's going to be in the platform-tools folder. flash_all.bat (for Windows or flash_all.sh (for Linux/macOS).
- Connect your phone in fastboot mode (clip Volume down + Power when the device is off).
- Run the firmware script: flash_all.bat For Linux/macOS First, give permission to execute: chmod +x flash_all.sh./flash_all.sh
- Wait until the process is completed (the process takes 5-15 minutes).
If the script produces a fastboot: error: Cannot generate image for userdata, it means that the userdata partition has not been cleared.
- Manually clean up: fastboot erase userdata
- Reset the script flash_all.bat.
| Mistake. | Reason. | Decision |
|---|---|---|
| fastboot: error: Failed to boot into fastbootd | The device does not support fastbootd (relevant for older models) | Use the command fastboot oem reboot-edl and swipe through the Mi Flash Tool |
| Invalid sparse file format at header | Damaged firmware file or model mismatch | Download the firmware again and check the name of the model in flash_all.bat |
| Device is locked. Cannot flash | The bootloader is not unlocked | Return to the section on unlocking the bootloader |
π‘
Firmware via fastboot erases all data, including internal memory. If you want to save files, use the ADB sideload method (described below).
5. firmware through ADB Sideload: Update without data loss
The ADB sideload method allows you to install a MIUI update without completely cleaning the device.
- π² Updates by airΒ» (OTA), If it doesnβt come automatically.
- π Recoiling on the previous version MIUI (if the new one is not working properly).
- π Install security patches without resetting settings.
Importantly, this method does not work for the transition between global and Chinese versions of MIUI (for example, from MIUI China to MIUI Global).
Instructions:
- Download firmware in.zip format (for example, miui-blockota-global-V14.0.2.0.TKWMIXM-V14.0.1.0.TKWMIXM-12.0.zip).
- Move the file to the platform-tools folder and rename it to update.zip for convenience.
- On the phone, go to Settings β About Phone β System Update, click on the three dots in the upper right corner and select Select Update File.
- Select the downloaded update.zip. The system will prompt you to reboot to recovery mode.
- From the recovery menu, select Apply update β Apply from ADB.
- On PC, run the command: adb sideload update.zip The process will take 3-10 minutes. Once completed, select Reboot system now.
β οΈ Note: If after the scaling of the ADB sideload phone hangs on the logo MI, Reset via Recovery (Wipe Data) β Wipe all data. This is due to incompatibility of the kernel or modules.
6. Install custom firmware (LineageOS, Pixel Experience)
Custom firmware like LineageOS or Pixel Experience gives you more freedom, but itβs more difficult to install, and youβll need to have an unlocked bootloader.
- π§ Install custom recovery (custom recovery), for example, TWRP Or OrangeFox.
- π¦ Download firmware, GApps (if you need Google services) and Magisk (for root rights).
- β οΈ Check firmware compatibility with your model (e.g. LineageOS 20 does not support Xiaomi Redmi Note 10 Pro due to camera driver issues).
Step-by-step:
- Please. TWRP Fastboot: Fastboot Flash Recovery twrp-3.7.0_12-1-sweet.img fastboot reboot recovery
- In TWRP, run Wipe β Format Data (enter yes for confirmation).
- Transfer your firmware, GApps, and Magisk files to your phone via MTP (TWRP has the Mount β Enable MTP option).
- Install firmware, then GApps, then Magisk (order is important!).
- Reboot to the system. The first launch can take up to 15 minutes.
Problems after installing custom firmware:
| Problem. | Possible cause | Decision |
|---|---|---|
| The camera's not working. | There are no proprietary Xiaomi drivers | Install the patch. ANX_Camera or go back to MIUI |
| No network (IMEI missing) | The modem or EFS partition is damaged | Restore the EFS backup or flash the official firmware |
| Fast battery discharge | Unoptimized kernel or background processes | Install the FrancoKernel core or calibrate the battery |
7. Solving common mistakes
Even with the correct following of the instructions, errors can occur, and here are the most common ones and ways to fix them:
- π adb: device unauthorized β You'll see a request for debugging permission on your phone.
- π fastboot: error: Command not allowed β The bootloader is not unlocked or the device does not support the command. Check the unlock status of the command: fastboot oem device-info Look for the line Device unlocked: true.
- π± E: unknown command [sideload] β An outdated version of recovery.Update TWRP Or use fastboot.
- β‘ Battery low! Please charge and try again β Battery charge below 30%. Connect to charge and try again.
If the phone doesnβt turn on after firmware (black screen or logo hanging), try:
- Press Volume up + Power for 10-15 seconds for forced reboot.
- Connect to your PC and check the output of the command: fastboot devices If the device is determined, repeat the firmware.
- If the command returns a blank list, the phone can be in EDL mode. To exit it, you will need the Mi Flash Tool and an authorized Mi Account.