Xiaomi Firmware through Fastboot with PC: A Complete Guide from Preparation to Installation

Fastboot is one of the most reliable ways to upgrade or restore a device when standard methods don’t work, and it’s a method that can be used to install official and custom firmware, fix bugs after a failed β€œover the air” update, and unlock additional features. However, the process requires care: wrong actions can turn a phone into a β€œbrick.” In this article, we’ll look at all the stages of firmware, from PC and smartphone preparation to final restart, and also explain how to avoid typical errors.

It is important to understand that the firmware through Fastboot erases all user data, so be sure to back up important files. The method is suitable for most Xiaomi, Redmi and POCO models, but there are nuances for devices with a locked bootloader (they will have to be pre-unlocked). If you have never engaged in such manipulations, we recommend that you carefully study each step - this will save you from unpleasant surprises.

What is Fastboot and When You Need It

Fastboot mode is a low-level interface for interacting with the hardware of a smartphone via a PC. Unlike normal Android boot, it allows you to install firmware, restore system partitions and even β€œresuscitate” devices that are not turned on.

  • πŸ”„ The smartphone is getting stuck on the Mi logo or cyclically rebooting (bootloop").
  • πŸ“± We need to install an official firmware. MIUI after a failed update OTA.
  • πŸ”“ You need to unlock the bootloader before installing custom firmware (for example, LineageOS).
  • πŸ› οΈ System files must be restored after a virus attack or failure.

The main advantage of Fastboot over Recovery is that it can be used to flash a device even when it has a damaged system when there is no access to the recovery menu, but it also has its downsides: it requires a PC connection, drivers, and command line work. This may seem difficult for beginners, but with the right approach, the risks are minimal.

⚠️ Attention: Fastboot resets the settings to factory settings if the device has data encryption enabled (default in the device) MIUI 12+), After the firmware, access to internal memory will be blocked before the first login with the same Mi Account.

Preparation of smartphone and PC

Before you run the firmware, you have to take a few critical steps, and skipping any of them can lead to errors like fastboot: error: can't load or a brick.

  1. Check the smartphone model. Go to Settings β†’ Phone β†’ Model. For example, the Redmi Note 10 Pro may have the code name sweet, and the Xiaomi 11T Pro may have the code name vili.
  2. Turn on USB debugging. Go to Settings β†’ About Phone, tap 7 times on the MIUI version to activate Developer Mode. Then to Settings β†’ Additional β†’ For Developers, turn on USB Debugging and OEM Unlock (if any).

Now, prepare the computer:

  • πŸ–₯️ Install Android SDK Platform-Tools (includes fastboot and adb).
  • πŸ”Œ Download drivers for your Xiaomi model (e.g. Mi). USB Driver).
  • πŸ“ Create a folder for firmware (for example, C:\Xiaomi_Flash) And unpack the archive with firmware.

I got the code name of the model.|I've got the debugging on. USB unlock OEM|Charged the phone. >50%|Download Android SDK and drivers|I got a firmware folder ready.-->

If you are flashing a device with a locked bootloader (for example, a new one out of the box), pre-unlock it through the Mi Unlock Tool.

Mi Flash Tool|Fastboot via command line |TWRP|Other tool-->

Selection of firmware: official vs custom

The type of firmware not only determines the functionality of the device, but also the risk of errors. Official MIUI firmware is divided into three types:

Type of firmwareDescriptionFor whom?
StableStable version with minimal bugs, updated every 1-2 months.For everyday use.
DeveloperWeekly builds with new features, but errors are possible.For enthusiasts and testers.
FastbootFull system image for installation via Fastboot (extension.tgz).For recovery or forced firmware.
RecoveryUpdate via the Restore Menu (.zip extension).For upgrades without a PC.

You only need to download official firmware from the official Xiaomi website. For custom firmware (for example, Pixel Experience or ArrowOS), use proven sources like XDA Developers.

  • πŸ“Œ Compatible with your model codename (e.g., Raphael for Redmi) K20 Pro).

⚠️ Warning: Installing custom firmware on devices with a locked bootloader will trigger anti-Rollback protection, which can render the phone inoperable without the possibility of recovery via Fastboot.

What is Anti-Rollback?
Anti-Rollback is a protection mechanism in Xiaomi smartphones that blocks the rollback to an older version of the firmware. If you try to install a version of MIUI older than the current one (for example, from 13 to 12), the device will be locked.

Unlocking the loader (if necessary)

All new Xiaomi smartphones come with a locked bootloader, a security measure that prevents unofficial software from being installed. To flash the device through Fastboot, the bootloader needs to be unlocked.

  1. Link your Mi Account to your device in Settings β†’ Xiaomi Account.
  2. Download the Mi Unlock Tool and install it on PC.
  3. Launch the utility on behalf of the administrator, log in to your Mi Account.
  4. Connect your phone in Fastboot mode (turn off the device, then press Volume Down + Power).
  5. Click Unlock in the program and wait until it is completed (usually takes 3-5 minutes).

Important nuances:

  • πŸ” Unlocking resets all data on the device.
  • ⏳ After unlocking some models (for example, Redmi Note 9 Pro) you need to wait 72 hours before re-assigning your account.
  • πŸ“΅ If the utility gives an error Couldn’t unlock, check that the phone is recognized in Device Manager as Android Bootloader Interface.

Once the boot loader is unlocked, a warning will be displayed on the boot screen that the boot loader has not been checked. This is normal and does not affect the operation of the device.

Step-by-step instructions for firmware through Fastboot

When you're done, you can start firmware, and we'll look at two ways: through the Mi Flash Tool (for official firmware) and through the command line (the universal method).

  1. Download and install the Mi Flash Tool.
  2. Unpack the firmware archive (.tgz) in a folder without Cyrillic characters (for example, C:\Xiaomi_Flash\proshivka).
  3. Run MiFlash.exe on behalf of the administrator.
  4. Connect your phone in Fastboot mode (see above).
  5. In the program, click Select, specify the folder with the firmware, then Refresh - the device must be determined.
  6. Select firmware mode: Clean all – clean (recommended); Clean all and lock – clean + lock bootloader (only for official firmware!); Save user data – data storage (not always stable).

Flash

Method 2: Command Prompt (for experienced)

If you prefer manual control or have custom firmware, use fastboot commands:

  1. Open the command line in the folder with platform-tools (press Shift + PCM β†’ Open the PowerShell window here).
  2. Check the connection of the device: fastboot devices should display the serial number of the phone.
  3. Unpack the firmware and find the file flash_all.bat (For official) or follow the instructions for custom firmware.
  4. For official firmware, run: flash_all.bat For custom, enter manual commands, such as: fastboot flash boot boot.img fastboot flash system system.img fastboot flash vendor vendor.img fastboot reboot

πŸ’‘

If the phone doesn't turn on after the firmware is done, don't panic. 90% of the time, the problem is solved by re-routing the firmware with complete data cleaning, and the main thing is not to interrupt the process and use the verified firmware files.

What to do after the firmware

Successful firmware is only half the battle, and after the first download, you need to do several things to keep the device running smoothly:

  1. First setup: Go through the initial configuration (language selection, Wi-Fi connection, Mi Account login) If the firmware is customized, you may need to install Gapps (Google services).
  2. Checking the health. Make sure it works: πŸ“Ά Mobile network and Wi-Fi. πŸ”Š Sound and microphone. πŸ“· Cameras (front and main). πŸ”‹ Charging (connect the charger).

Firmware update.

MIUI

Settings β†’ Updating the system

Data recovery.

Mi Cloud

If you have stitched custom firmware, install the Magisk kernel to obtain root rights (if necessary) and check compatibility with Xposed or LSposed modules. Remember that some features (such as Mi Pay or Game Turbo) may not work on informal builds.

How to return the official firmware after custom?
To return to the official MIUI after custom firmware: 1. Download the official Fastboot firmware for your model. 2. Sweat it through the Mi Flash Tool with the Clean all. 3. If the bootloader has been unlocked, it can be re-locked (check Clean all and lock), but this is not necessary. 4. After the reboot, reset to the factory settings in the Recovery menu (press Volume up + Power at boot).

FAQ: Frequent questions about Xiaomi’s firmware through Fastboot

Can I flash Xiaomi through Fastboot without unlocking the bootloader?
No, official firmware via Fastboot is only installed on unlocked devices, except for the firmware via the Mi Flash Tool with the Clean all and lock tick, but it is only available for official builds and requires prior unlocking.
How do I know if my Xiaomi bootloader is unlocked?
Turn off the phone, then press Volume Down + Power to log into Fastboot. If there's an Unlocked inscription at the bottom of the screen or an open lock icon, the bootloader is unlocked. If there's no writing or there's a Locked, it's locked.
What if the Mi Flash Tool can't see the phone?
Try the following steps: Install drivers manually through Device Manager (update the driver for Android Bootloader Interface). Use the original USB cable and USB 2.0 port (USB 3.0 may not work); Run the Mi Flash Tool on behalf of the administrator. Check if the device is detected in the command line (fastboot devices).
Can I flash Xiaomi via Fastboot on Mac or Linux?
Yes, but the process is a little different: On a Mac, install fastboot via Homebrew (brew install android-platform-tools). On Linux, use the android-tools-fastboot package (e.g., sudo apt install android-tools-fastboot for Ubuntu). The fastboot commands remain the same, but specify the paths to the files with your OS syntax in mind. The Mi Flash Tool only works on Windows, so you will have to use the command line for Mac/Linux.
After the firmware, the phone doesn't turn on.
If the screen is black or the Mi logo is burning for more than 10 minutes: Try going to Fastboot. + Power) and repeat the firmware with full cleaning. If it doesn't work, run a different firmware version (e.g. Stable instead of Developer). Check if the firmware code name matches the phone model (e.g., raphael for Redmi. K20 If nothing helps, contact the service center - it is possible that the hardware is damaged.