How to enable USB installation on Xiaomi smartphones: unlock the bootloader and hidden functions

Installing firmware via USB on Xiaomi smartphones is a powerful tool for power users to update the system manually, restore the device after a crash, or even install custom firmware. However, by default, this feature is blocked by the manufacturer due to security risks. In this article, we will discuss in detail how to properly activate the installation mode via USB, what pitfalls can meet on the way, and what to do if the smartphone refuses to see the boot file.

The process differs from the standard air-to-air update (OTA) and requires pre-preparedness: unlocking the bootloader, creating the right file structure on the flash drive and even occasionally using a PC. We will look at official methods for MIUI and alternative solutions for devices with a locked bootloader. Particular attention will be paid to the Redmi Note 12, POCO X5 and Xiaomi 13 models, where the algorithm may differ from older smartphones.

It's important to understand that doing the wrong thing can lead to a device being "bricked," so every step comes with warnings and recovery tips, and if you're a beginner, we recommend that you learn the theory of the types of firmware (Fastboot, Recovery) first and then start practicing.

Why Xiaomi is blocking USB installation and how to get around it

The manufacturer limits the ability to install firmware via USB for two key reasons: security and ecosystem control. Unlike Google Pixel or Samsung, where unlocking the bootloader takes minutes, Xiaomi requires a Mi Account binding and waiting up to 720 hours (30 days) for new devices.

Bypassing the lock is possible through:

  • πŸ”“ Official unlocking of the bootloader through the Mi Unlock Tool (requires waiting and account confirmation).
  • πŸ“± Hidden engineering menus (e.g. ##4636## for testing or fastboot oem edl for switching to mode) EDL).
  • πŸ’» Use of third party utilities like XiaomiTool V2 MiFlash (Risky for Beginners).
  • πŸ”„ Exploiting vulnerabilities in older versions MIUI (For example, bypassing waiting through downgrade firmware).

Since 2023, Xiaomi has tightened its policy on new models (for example, Xiaomi 14 or Redmi Note 13 Pro).+) It is impossible to unlock the bootloader without the phone number tied to the Mi Account. This complicates the process for users who bought the device with or without the original device. SIM-map.

⚠️ Note: If you bought a smartphone on AliExpress or Avito without an attached account, unlocking the bootloader may not be possible. Check the lock status through the command fastboot oem device-info - if in the response Device unlocked: false, you need to contact the previous owner.

Preparation of the smartphone: unlocking the loader

The first and most important step is to unlock the bootloader, without which the smartphone will simply ignore any attempts to install the firmware via USB.

  1. Linking your Mi Account to your device (required via the official Mi Unlock app).

Detailed instructions:

  1. Download the official Mi Unlock Tool (the version must match your MIUI).
  2. Turn on the smartphone developer mode: go to Settings β†’ About Phone β†’ MIUI version and tap 7 times on the line with the version.
  3. Back to Settings β†’ Additionally. β†’ For developers and activate: πŸ”§ Debugging by USB πŸ”“ Unlocking OEM (It may be called a factory unlock)

Mi Unlock Tool

Mi

Added account successfully. Waiting for {X} hours

πŸ“Š How long are you willing to wait for the bootloader to unlock?
Up to 7 days.
1-2 weeks
More than 2 weeks.
Looking for workarounds

After the waiting period expires, reconnect to the PC. The utility should show the Unlock button. Press it, the smartphone will restart, and the bootloader will be unlocked. Attention: after unlocking, there will be a full reset (wipe)!

What if the Mi Unlock Tool can’t see the device?
1. Make sure that Qualcomm or MediaTek drivers are installed (depending on your smartphone’s processor). 2. Try another one. USB-cable (preferably original). 3. Disable the antivirus - it can block the utility. 4. Reboot your PC and smartphone in Fastboot mode (clip Volume Down) + Power with the phone turned off).

Creating a bootable flash drive for Xiaomi

To install the firmware via USB, you will need a properly formatted flash drive (up to 64 GB of USB 3.0 is recommended) and the correct file structure, and errors at this stage are the most common cause of failure.

Requirements for the flash drive:

  • πŸ“ Format: FAT32 (not exFAT or NTFS!).
  • πŸ”„ Cluster size: 4096 bytes (default when formatting).
  • 🚫 No encryption or record protection.
  • πŸ”‹ Charge of the smartphone battery: at least 50% (when installing firmware, discharge can lead to a breeze).

The structure of files on the flash drive depends on the type of firmware:

Type of firmwareFiles on the flash driveFolder (if needed)Example of file name
Recovery (through stock recovery)One. ZIP-archiveNo (file root)miui_BLOCKNAME_V14.0.5.0.TKLCNXM_1234567890_12.0.zip
Fastboot (via MiFlash)Plenty IMG-fileYeah (unpacked folder)images/boot.img, images/system.img
Castomium (TWRP)ZIP + IMG (core)No.twrp-3.7.0_12-raphael.img + Magisk-v26.1.zip

Where to download the firmware:

  • 🌍 Official firmware: Xiaomi website (choose version for your model!).
  • πŸ”§ Custom firmware: XDA Developers (e.g. Pixel Experience or LineageOS).
  • ⚠️ Check the hashes of the files (MD5/SHA1) β€” The downloaded firmware must match the official data.

β˜‘οΈ Preparation of the flash drive for firmware

Done: 0 / 5

Installation of firmware via USB: a step-by-step process

Once the bootloader is unlocked and the flash drive is ready, you can start installing it. Let's look at two scenarios: through stock recovery and through Fastboot.

Method 1: Installation through Recovery (for ZIP-firmware)

This method is suitable for official firmware in.zip format and custom assemblies.

  1. Turn off your smartphone.
  2. Press Volume Up + Power to Enter Recovery Mode.
  3. Select a language (if you have a choice) and go to Install update.zip to System (the name may vary).
  4. Connect the flash drive through OTG-Adapter (or insert into your smartphone if supported).
  5. Select the firmware file and confirm the installation.
  6. Wait until the end (usually 5-15 minutes) and restart.

Method 2: Installation via Fastboot (for IMG-firmware)

This method requires a PC and MiFlash or fastboot utility.

  1. Unpack the firmware in a folder on the PC (for example, C:\miui_fastboot).
  2. Transfer the smartphone to Fastboot mode (Loudness down + Power).
  3. Connect to your PC and check for detection by the command: fastboot devices must display the serial number of the device.
  4. For full installation, run: fastboot flash all Or for selective (e.g. system only): fastboot flash system.img
  5. Reboot the command: fastboot reboot

πŸ’‘

If MiFlash gives an error critical partition flashing is not allowed, try selecting clean all and lock mode in the utility settings (but this will block the bootloader again!).

Common mistakes and their solutions

Even with the correct instructions, errors can occur, and here are the most common ones and how to correct them:

Mistake.Reason.Decision
Couldn't mount USB in RecoveryIncorrect format of the flash drive or OTG-adapterReformat the flash drive to FAT32 with a cluster size of 4096. Try another adapter.
E: Footer is wrong or E: Signature verification failedDamaged. ZIP-firmwareDownload the firmware again and check it out. MD5-Turn off signature verification in TWRP (if used).
fastboot: error: Failed to boot into fastbootdbootloader locked or drivers not installedCheck the fastboot oem device-info. Install Qualcomm or MediaTek drivers.
Smartphone got stuck on the MI logo after firmwareIncompatible firmware or interrupted processTry to reflash through Fastboot with a full reset (fastboot erase userdata).

Critical error: if after firmware smartphone does not turn on and does not respond to buttons, do not panic - in 90% of cases it is a "soft breeze", which is treated by transferring to EDL (Emergency Download Mode) mode through test points or a special cable.

⚠️ Note: On Xiaomi models with MediaTek processor (e.g. Redmi) 10C or POCO M5) enter EDL You may need an authorized Mi Account with service center rights!

Alternative ways to install firmware without USB

If unlocking the bootloader or working with USB is difficult, consider alternative methods:

  • πŸ”„ Local Update via Updater: Download ZIP-Firmware. Go to Settings. β†’ The phone. β†’ Updating the system β†’ Three points. β†’ Select a firmware file. Select the downloaded file and wait for the installation.
  • πŸ“± ADB Sideload: installation ZIP via adb sideload filename.zip Recovery mode (requires an unlocked bootloader).