How to reflash Xiaomi phone through PC: a detailed guide with nuances

Flashing a Xiaomi smartphone through a computer is a process that can solve many problems, from bugs in the system to a complete change of interface. However, the wrong actions often lead to the โ€œbrickingโ€ of the device, loss of data or cancellation of warranty, this guide will help to avoid typical errors and conduct the procedure as safely as possible.

Unlike the Air Update (OTA), PC firmware gives you more control: you can choose any version of MIUI (including global, Chinese or European), install custom software like LineageOS, or even bring the device back to life after a failed upgrade, but this will require unlocking the bootloader, preparing special tools and following a strict sequence of actions.

It is important to understand that the process is different for different models Xiaomi, Redmi and POCO. For example, for Xiaomi 13 Pro and Redmi Note 12, different versions of the Mi Flash Tool are used, and older devices (until 2019) may require additional manipulation of the Mi Account. In this article, we will look at the universal algorithm that is relevant for most modern gadgets of the brand.

1. Firmware Preparation: What to Do Before Starting

The first and most important step is data backup, and PC firmware completely erases the deviceโ€™s internal memory, including photos, contacts, and installed apps, and even if you plan to upgrade without a โ€œfastboot update,โ€ the risk of data loss remains.

Use the official Mi Mover app or third-party utilities like Titanium Backup (requires root rights).

  • ๐Ÿ“ธ Photos and videos (including hidden folders) DCIM/.thumbnails)
  • ๐Ÿ“ž Contacts (export to) VCF-file through Contacts โ†’ Management โ†’ Imports/Exports)
  • ๐Ÿ“„ Messages (annexes of type) SMS Backup & Restore)
  • ๐ŸŽฎ Save games (via cloud or manual folder transfer) Android/obb)

Also check:

  • ๐Ÿ”‹ Battery charge (at least 60%, ideally 100%) firmware can be interrupted at low charge.
  • ๐Ÿ”Œ Cable USB (Use an original or certified USB-C/Micro-USB). Cheap cables often cause connection errors.
  • ๐Ÿ–ฅ๏ธ Computer on Windows 7/10/11 (Mi Flash Tool is required for 64-bit system. macOS/Linux trickier.

โš ๏ธ Note: If your Xiaomi was purchased in China, the firmware of the global version MIUI can block the modules NFC or 5G. Check the compatibility of the model on the Xiaomi forum EU.

๐Ÿ“Š What kind of firmware do you plan to install?
Official MIUI (Stable)
Official MIUI (beta)
LineageOS (Pixel Experience)
I don't know, I need help.

2 Unlocking the bootloader: a mandatory step for firmware

All modern Xiaomi smartphones come with a bootloader locked, a security measure that prevents unofficial software from being installed.

  1. Link the device to your Mi Account (require to confirm your email and phone!).
  2. Apply for unblocking through the official website.
  3. Wait 7-15 days (depending on the model and region).
  4. Use the Mi Unlock Tool for the final unlock.

Important nuances:

  • ๐Ÿ“… For new models (such as Xiaomi 14 or Redmi Note 13), the waiting period can be up to 30 days.
  • ๐Ÿ” Mi Account must be created at least 30 days ago (otherwise the system will reject the application).
  • ๐Ÿ“ฑ The device must have the latest official firmware installed (update via Settings). โ†’ The phone. โ†’ Updating the system).

After approval of the application:

  1. Download Mi Unlock Tool from the official website.
  2. Launch the utility on behalf of the administrator.
  3. Connect your phone in Fastboot mode (clip Volume Down + Power when the device is off).
  4. If you see a Couldn't unlock error, try again in 24 hours.

โš ๏ธ Warning: Unlocking the bootloader resets the device to factory settings.All data will be deleted even if you backed up through the Mi Cloud.

What if the Mi Unlock Tool canโ€™t see the device?
1.Make sure drivers are ADB installed (download them via Android Studio). 2. Check if debugging is enabled USB In Settings โ†’ For developers. 3. Try another one. USB-port (preferably) USB 2.0). 4. Disable the antivirus - it can block the utility.

3. firmware selection: official MIUI vs custom builds

The type of firmware depends on the functionality of the device, the stability of work and even support for some modules (for example, a camera or NFC).

Type of firmwareAdvantagesDeficienciesSuitable for
Official MIUI (Stable)Maximum compatibility, support OTA-Updates, all functions are workingAdvertising in system applications, limited customizationUsers who need stability
Official MIUI (beta)New features before, less advertisingBugs, unstable work, possible problems with the batteryEnthusiasts ready for experimentation
Xiaomi.EUAdvertising-free, advanced settings, weekly updatesNo official support, possible bugsAdvanced users
Castomium (LineageOS, Pixel Experience)Clean Android, long-term support, no BloatwareCamera, NFC or wireless charging may not workThose who want Android without a MIUI shell

Where to download the firmware:

  • ๐ŸŒ Official: en.miui.com (select the version for your model!).
  • ๐Ÿ‡ช๐Ÿ‡บ Xiaomi.EU: xiaomi.eu (requires registration on the forum).
  • ๐Ÿ› ๏ธ Castomy: XDA Developers (Search for the theme of your model).

Before downloading, check:

  • ๐Ÿ”  Model code (e.g. Redmi Note 12 Pro)+ 5G It has a ruby code. You can find it in Settings. โ†’ The phone. โ†’ Model or via the Quickboot Getvar Product command.
  • ๐Ÿ”„ Version MIUI (Installing the beta over a stable version can lead to a download cycle.
  • ๐Ÿ“ฅ File integrity. The firmware must be.tgz or.zip (not.exe (MD5) utility-wise WinMD5Free.

๐Ÿ’ก

If you downloaded firmware in.tgz, don't unpack it manually! Mi Flash Tool will do it automatically. Manual file extraction can lead to installation errors.

4. Installation of drivers and necessary tools

For firmware through the PC will require:

  1. Mi Flash Tool is the official utility from Xiaomi for installing firmware in Fastboot mode.
  2. ADB and Fastboot are tools for interacting with a device via the command line.
  3. Qualcomm/MTK drivers depend on your smartphoneโ€™s processor.

Step-by-step installation:

  1. Download the Mi Flash Tool (version 2023.4.25.0 or later).
  2. Install Android SDK Platform Tools (includes adb and fastboot).
  3. For Qualcomm processors, download the QDLoader drivers, for Mediatek - MTK USB Drivers.
  4. Connect your phone in Fastboot mode and wait for the drivers to be installed (Android Bootloader Interface should appear in Device Manager).

Check the connection via the command line:

fastboot devices

If the device is identified (its serial number will appear), the drivers are installed correctly. If not, reinstall them manually through Device Manager.

โš ๏ธ Attention: On Windows 11 You may need to disable driver signature verification. To do this, do the command line (on behalf of the administrator): bcdedit /set nointegritychecks on After installing drivers, return the settings back: bcdedit /set nointegritychecks off

โ˜‘๏ธ Tool preparation

Done: 0 / 4

5. The firmware process through the Mi Flash Tool

Now, to the most critical phase, there are two options for firmware: Fastboot (full cleanup) or Recovery (data storage), and we'll look at the former, because it's more reliable and suitable for most scenarios (including disaster recovery).

Step-by-step:

  1. Unpack the downloaded firmware (if it is in the archive) in a folder without Cyrillic characters (for example, C:\MIUI\).
  2. Run the Mi Flash Tool on behalf of the administrator.
  3. Connect your phone in Fastboot mode (clip Volume Down + Power when the device is off).
  4. In the program, click Select and specify the path to the folder with the firmware.
  5. Select firmware mode: Clean all - complete cleaning (recommended for changing the version of MIUI); Clean all and lock - cleaning + lock bootloader (only for official firmware!); Save user data - data storage (not always working correctly).

Flash

If the process is suspended on Waiting for device:

  • ๐Ÿ”Œ Check the cable and port USB.
  • ๐Ÿ”„ Reboot your phone in Fastboot again.
  • ๐Ÿ–ฅ๏ธ Reinstall drivers or try another computer.

Once the firmware is successful, the device will automatically restart. The first run can take up to 15 minutes - don't interrupt the process!

๐Ÿ’ก

If the phone is stuck on the MI logo after firmware, try resetting via Recovery (click Volume Up + Power and select Wipe Data).

6. Install custom firmware (LineageOS, Pixel Experience)

If you chose unofficial software, the algorithm will be more complex, and in addition to unlocking the bootloader, you will need to:

  1. Install custom recovery (TWRP or OrangeFox)
  2. Format the /data, /system and /vendor partitions.
  3. Install firmware and GApps (Google services if needed).

Instructions for TWRP:

  1. Download TWRP for your model from the official website.
  2. Fastboot: Fastboot Flash Recovery twrp-3.7.0_12-1-ruby.img fastboot boot twrp-3.7.0_12-1-ruby.img
  3. In TWRP, select Wipe โ†’ Format Data (enter yes for confirmation).
  4. Transfer firmware and GApps to your phone via MTP (TWRP has this option).
  5. Install firmware first, then GApps (order is important!).
  6. Reboot to the system.

Typical errors when installing custom firmware:

  • ๐Ÿšซ Error 7 is the wrong model. Check firmware compatibility.
  • ๐Ÿšซ Logo hanging - no vendor or firmware. Download additional files from the forum XDA.
  • ๐Ÿšซ No network, run separately modem and EFS through TWRP.

โš ๏ธ Attention: Castom firmware often breaks encryption, and if you have a phone that asks for a password after you install it, but doesn't accept it, you'll have to format it. /data Re-invented (all data will be lost!).

7.What to do if the firmware failed

Situations where the device is not turning on or is not working correctly, even in experienced users.

Problem.Possible causeDecision
Phone not turned on (black screen)Incorrect firmware or interrupted processRepeat the firmware through Fastboot with a full clean (Clean all)
Hanging on the MI logoMIUI version conflict or damaged partitionsReset settings via Recovery or flash anti-rollback firmware
No network or IMEIThe modem or EFS partition is damagedRestore EFS via TWRP or run through the original vendor
Cyclical reboot (bootloop)Incompatible firmware or lack of vendorInstall firmware with the same build number (MIUI version) as before

If the phone doesnโ€™t respond to the buttons:

  • ๐Ÿ”‹ Connect to charging for 30 minutes - maybe the battery has gone down.
  • ๐Ÿ”Œ Try to pin the volume down. + Power for 20-30 seconds (forced Fastboot).
  • ๐Ÿ–ฅ๏ธ Connect to your PC and check if your device is detected via fastboot devices.

For devices with a Mediatek processor (for example, Redmi 9A or POCO M3), you may need the SP Flash Tool utility.

8. System optimization after firmware

After successful installation of firmware, it is recommended:

  • ๐Ÿ”„ Reset to factory settings (via Settings) โ†’ Additionally. โ†’ Recovery and resetting. This will eliminate potential conflicts.
  • ๐Ÿ”’ Turn it on. OEM Unlock and USB Debugging (if you plan to manipulate further).
  • ๐Ÿ“ฑ Update all apps via Google Play or Mi App Store.
  • ๐Ÿ”‹ Calibrate the battery: fully discharge and charge the phone 2-3 times.

To improve productivity:

  • Turn off animation via Settings โ†’ For developers (set Windows Animation = Off).
  • Limit the background activity of applications in Settings โ†’ Battery โ†’ Battery Optimization.
  • Remove unnecessary system applications via ADB: adb shell pm uninstall-k --user 0 com.miui.analytics

If there are bugs after the firmware (for example, Always On Display or gestures do not work), check:

  • ๐Ÿ“‹ Compatibility of firmware with your model (on the forum Xiaomi) EU Lists of supported functions).
  • ๐Ÿ”„ Availability of firmware updates (in Xiaomi.EU they are released weekly).
  • ๐Ÿ› ๏ธ Magisk Installation Correctness (if root is installed).

๐Ÿ’ก

Once custom software (like LineageOS) is firmware is installed, encryption support may be lost. To return it, file separate dm-verity and forceencrypt patches via TWRP.

FAQ: Frequent questions about Xiaomi firmware

Can I use Xiaomi without unlocking the bootloader?
No, official firmware through the Mi Flash Tool requires an unlocked bootloader, except for an update via Recovery (if the MIUI version matches the current one), and Castom firmware is only installed on unlocked devices.
How to return the official firmware after custom?
Download fastboot firmware for your model from the official website, unlock the bootloader (if it was blocked) and run through the Mi Flash Tool in Clean all and lock mode. This will return the device to factory condition.
Why does the Mi Flash Tool give you the error "Flash is not done"?
The reasons may be different: Mi Flash Tool (new models need 2023 or later) Bad firmware file (check out new models) MD5-Hash. Antivirus conflict (disable it while you're firmware). Unstable connection USB (Solution: Reboot your PC and phone, repeat the process with another version of the utility.
Can I use Xiaomi on Mac or Linux?
Yes, but the process is more complicated: Macs will require fastboot installation via Homebrew (brew install android-platform-tools). Linux requires adb and fastboot packages (installe via sudo apt install adb fastboot). Mi Flash Tool only works on Windows, so you will have to use alternative scripts to run Fastboot (e.g. XiaomiFlash for Linux).
How to check if the bootloader is unlocked?
Turn off your phone and press Volume Down + Power to log into the Fastboot. If there's Unlocked at the bottom of the screen and the yellow lock icon, the bootloader is unlocked. If Locked is locked.