How to flash Xiaomi smartphone through PC: a complete guide from preparation to installation

Firmware Xiaomi smartphone through the PC โ€“ a task that scares many users because of the risk of โ€œbrickingโ€ the device. But with the right approach, this process allows not only to update the system to the latest version, but also to bring back to life the "dead" machine, eliminate software bugs or gain root access. OTA-Updates, firmware through the computer gives full control over the version MIUI, Option between global (Global), Chinese (China) or custom firmware.

This guide will be suitable for most Xiaomi, Redmi and POCO, post-release 2018 years, including Xiaomi 13/14 series, Redmi Note 12/13, POCO F5/X5 And we're going to go through two basic methods: Fastboot, and EDL (Important: the process requires care - an error in the selection stage of firmware or interruption of the installation can lead to loss of IMEI or complete inoperability of the communication module.

1. Firmware Preparation: What to Do Before Starting

Before you start firmware, make sure that all the preliminary steps are followed, and ignoring them is the main reason for failure.

Data retention is a must. PC firmware erases all user files, including photos, contacts and messages. Use Mi Cloud or local backup via Settings โ†’ About Phone โ†’ Backup. Pay special attention to:

  • ๐Ÿ“ฑ Contacts (exports to VCF-file)
  • ๐Ÿ“ธ Photo/video (copying to PC or cloud)
  • ๐Ÿ”‘ Passwords from apps (write down or use password manager)
  • ๐ŸŽฎ Game saves (synchronization via Google Play or Mi Account)

Verify the model and version of MIUI. Set the exact model of the device through Settings โ†’ About Phone โ†’ Model (e.g. Redmi Note 12 Pro+ 5G has ruby code). The MIUI version can be found in the same menu. This information is critical for choosing the right firmware - an error will lead to a hard brick.

๐Ÿ“Š How often do you update your firmware on Xiaomi?
Every month.
Six months
Only with critical bugs.
Never updated.

2. Selection of firmware: official vs custom

The type of firmware depends on the functionality of the device and the risks. Official firmware from Xiaomi is divided into:

  • ๐ŸŒ Global (MIUI Global - for the international market, with Google services, but often updated later than the Chinese version.
  • ๐Ÿ‡จ๐Ÿ‡ณ China (MIUI China) โ€” without Google, but with new features sooner. Requires manual installation of GApps.
  • ๐Ÿ› ๏ธ Stable vs Developer: Stable vs Developer is bug-proofed, but developers get weekly updates.

Custom firmware (e.g. LineageOS, Pixel Experience) provides more freedom, but is not warranty and can contain bugs. Their installation requires an unlocked bootloader and TWRP.

Type of firmwareAdvantagesDeficienciesSuitable for
MIUI Global StableMaximum stability, Google servicesDelayed updates, advertising in MIUIUsers who need a โ€œworking phoneโ€
MIUI China DeveloperNew features first, less bloatwareWithout Google, there are bugs.Enthusiasts Ready to Manually Set Up
Castomic (AOSP)Pure Android, no Xiaomi adsNo warranty, possible camera/NFC issuesAdvanced users

Where to download? Official firmware is only taken from Xiaomi's website (Download section). For custom forums, XDA Developers or 4PDA. Never use firmware from torrent trackers or unknown sources - they may contain backdoors or viruses.

๐Ÿ’ก

Before downloading, check the hash amount (MD5) of the firmware with the MD5 Checker utility. This will protect against corrupted files.

3. Unlocking the bootloader: a must-do step for Fastboot

Without unlocking the bootloader, it is impossible to flash Xiaomi through Fastboot. The process requires linking the Mi Account to the device and waiting (usually 7-14 days).

  1. Activate Developer Mode: Settings โ†’ About Phone โ†’ MIUI version (click 7 times).
  2. Enable OEM Unlock and USB Debugging in Settings โ†’ Additional โ†’ For Developers.
  3. Link Mi Account to Settings โ†’ Xiaomi Account.
  4. Connect your phone to your PC, open the cmd and execute: adb reboot bootloader fastboot oem unlock

Once confirmed on the phone, the countdown will begin, and the unlock status can be checked by the team:

fastboot oem device-info
What to do if the unlock is 99% frozen?
If the process is 99% frozen, don't turn off the device! Wait 10-15 minutes. If there is no change: 1. Reboot the phone to Fastboot (Loudness down + Power). 2. Repeat the command fastboot oem unlock. 3. If persists error, use Mi Unlock Tool with administrator rights.

โš ๏ธ Warning: Unlocking the bootloader resets the device to factory settings, and it can also cause Widevine to lose. L1 (Deteriorating streaming quality at Netflix, Disney+). It can only be restored by reflashing in the service center.

4. Firmware through Fastboot: step-by-step instructions

This method is suitable for installing official firmware on working devices with the bootloader unlocked.

  • ๐Ÿ–ฅ๏ธ Windows PC 10/11 (For the Mi Flash Tool)
  • ๐Ÿ”Œ Cable USB (preferably original)
  • ๐Ÿ“ Firmware in.tgz format (unpacked)
  • ๐Ÿ› ๏ธ Used by Mi Flash Tool, ADB & Fastboot

Step 1: Install Xiaomi drivers (download here). Connect your phone in Fastboot mode (Loud down + Power).

Step 2. Launch the Mi Flash Tool, press Select, and point the path to the unpacked firmware.

  • Clean all โ€“ complete cleaning (recommended)
  • Clean all and lock โ€“ cleaning + locking the bootloader (only for official firmware!)
  • save user data โ€“ saving data (risky, can lead to bugs)

Step 3. Press Refresh, the program must detect the device (COM port). Then click Flash. It takes 5-10 minutes. Once it's done, the phone will restart automatically.

Device charged at least 60% | Xiaomi drivers installed |Firmware unpacked in folder without Cyrillic |Mi Account tied to phone |Further backup created

-->

โš ๏ธ Note: If after firmware the phone is stuck on the logo MI, Wait. 15-20 If you don't download, repeat the process with clean all. Don't use clean all and lock for custom firmware, it will lead to brick!

5. Firmware through EDL: Recovery of Bricks

EDL (Emergency Download Mode) is the last chance to bring back to life a device that is not powered on, not defined in Fastboot or has a corrupted firmware.

  • ๐Ÿ”ง Authorized account EDL (For new Xiaomi models)
  • ๐Ÿ’ป Mi Flash Pro or QFilm
  • ๐Ÿ“„ Firmware in.mbn format (for Qualcomm chipsets)

Algorithm:

  1. Transfer the phone to EDL: For working devices: adb reboot edl For "bricks": close the test points on the board (disassembly is required).

Mi Flash Pro

Flash

Wait until the process is completed (it can take up to 30 minutes).

Important: C 2023 Xiaomi tightened control over the EDL-For Snapdragon models. 8 Gen 2/3 (for example, Xiaomi 13 Ultra) requires authorization through an official service center. SLA Auth Fail.

๐Ÿ’ก

EDL-If you're not sure about your skills, go to the service center, and errors in this mode can damage the bootloader forever.

6. Solving common errors

Even with the exact following of the instructions, errors can occur.

Mistake.Reason.Decision
fastboot: error: Command failedIncompatible firmware or a corrupted fileCheck the device model and hash amount of the firmware
Mi Flash: "Can't find device"Drivers not installed or cable is faultyReinstall the drivers, try another one. USB-port
Hanging on the MI logoData conflict after firmwareRepeat the firmware with clean all
SLA Auth Fail (at EDL)Authorization is required for new chipsetsContact the service center.

Losing IMEI after firmware is a common problem, and you can restore it through Engineer Mode (enter ##4636##) or QCN Rebuilder. If IMEI is reset to 0, you will need to flash the modem partition.

The camera error after installing custom firmware is solved by installing the correct GCam or patch for libcamera.

7. Post-firmware optimization

After successful firmware is recommended:

  • ๐Ÿ”„ Perform a reset to factory settings (if you were stitched over the old system).
  • ๐Ÿ”’ Shut down. OEM Unlock in Developer Settings (for security).
  • ๐Ÿ“ฑ Update all apps through Google Play.
  • ๐Ÿ”‹ Calibrate the battery (discharge to 0% and charge to 100% without interruption).

To improve productivity:

  • Disable MIUI Optimization in the developer settings (reduce the lag).
  • Install Magisk for root rights (only if you need system modifications).
  • Use Greenify to freeze unnecessary apps.

Widevine Verification: After firmware check the DRM level in the DRM Info application. If L3 is displayed instead of L1, streaming services will be limited to 480p resolution. L1 can only be restored by official firmware through Mi Flash with a locked bootloader.

Frequently asked questions

Can I use Xiaomi without unlocking the bootloader?
No, to install firmware through Fastboot, unlocking is mandatory, except for the update via Recovery (if the firmware is signed for your model) or OTA. However, EDL-Firmware in service centers is possible without unlocking, but requires authorization.
How to return the official firmware after custom?
Download the Fastboot firmware for your model from Xiaomi, then swipe through the Mi Flash Tool with a clean all and lock option. This will lock the bootloader and restore the original MIUI. After the procedure, you will have to wait for unlocking again (if necessary).
Why is the mobile network not working after the firmware?
The reasons may be different: not present IMEI (Restore it with Engineer Mode. Incompatible firmware (e.g. China on Global) Modem is damaged (reflash it separately). Check settings APN In Settings โ†’ SIM-maps and mobile networks โ†’ Access points (APN).
How to Implement Xiaomi on Mac/Linux?
For Fastboot, use the terminal with adb/fastboot commands. Mac may require driver installation via Homebrew: brew install android-platform-tools Mi Flash Tool will require a Windows virtual machine (for example, via Parallels or VirtualBox).
Can I roll back the firmware to an older version?
Technically, yes, but Xiaomi blocks the downgrade through anti-rollback protection. Trying to install the old firmware will lead to a hard brick. MIUI 14.0.5 on 14.0.3). Check the anti-rollback version in the file flash_all_lock.bat.