How to install custom firmware on a Xiaomi smartphone via PC: the full guide 2026

Why do users choose custom firmware for Xiaomi?

Installing custom firmware on Xiaomi via PC is a process that opens up new possibilities for your smartphone, but requires care and preparation. Many owners of Redmi, POCO or Mi devices decide to do this step to get rid of pre-installed bloatware, get up-to-date security updates or install alternative shells like LineageOS and Pixel Experience. However, it is important to understand that this is not just an update through settings, but a full-fledged intervention in system software that can both revive an old device and turn it into a brick if errors.

The main reasons for switching to custom firmware usually boil down to three key points: performance (pure Android is faster than the ad-hoc MIUI), privacy (lack of Chinese surveillance services), and functionality (access to chips of the latest versions of Android on outdated models). For example, owners of the Redmi Note 8 Pro (2019) through custom firmware can get Android 14, while official support from Xiaomi has long been discontinued.

This guide will work for most Xiaomi, Redmi and POCO models released after 2018 (starting with the Mi 8 and Redmi Note 7).However, before you start, check if your device is supported on the XDA Developers or 4PDA forums – some budget models (such as the Redmi 9A) have a locked bootloader that cannot be unlocked legally.

Preparation of the device: unlocking the loader

The first and most critical step is to unlock the bootloader, without which no custom firmware will install. Xiaomi officially lets you unlock the bootloader, but the process involves waiting and binding to your Mi Account.

  • πŸ“± Xiaomi smartphone with a battery charge of at least 60% (when unlocked, the device is rebooted many times).
  • πŸ’» Computer running Windows 10/11 (Mi Unlock Tool requires Qualcomm drivers).
  • πŸ”— Cable USB Type-C (original or high-quality – cheap cables can interrupt the connection).
  • πŸ“§ Mi Account tied to the device (unblocking is impossible without it!).

The unlocking process takes 3 to 7 days due to Xiaomi’s policy: once the account is linked to the device, you need to wait for the confirmation SMS.

  1. Activate Developer Mode: Go to Settings β†’ About Phone β†’ MIUI version and tap the build number 7 times.
  2. Turn it on. OEM-unlocking and debugging USB Settings menu β†’ Additionally. β†’ For developers.
  3. Download the official Mi Unlock Tool and install it on PC.
  4. Connect your phone to your computer, launch the Mi Unlock Tool and log in under the same Mi Account as you do on your smartphone.
  5. If you see a message that says "Wait 168 hours" - wait exactly 7 days (attempts to get around this time lead to the blocking of your account).

⚠️ Warning: If you bought the phone with your hands, make sure the previous owner untie his Mi Account. Otherwise, unlocking will not be possible without his data. VPN Mi Unlock Tool – Xiaomi blocks such attempts.

πŸ“Š What is your experience with smartphone firmware?
Never stitched.
I've been running official updates.
I've been installing custom firmware.
I'm doing it professionally.

The best choice for the custom firmware: MIUI vs LineageOS vs Pixel Experience

Once the bootloader is unlocked, you need to decide on the firmware, and they're divided into three main categories:

  1. Modified MIUI (e.g. MIUI EU or xiaomi.eu): retains the branded interface but removes ads and Chinese services, suitable for those who like MIUI but want a clean system.
  2. AOSP-Firmware (LineageOS, Pixel Experience, ArrowOS): pure Android without Xiaomi shell. Optimal for weak devices (for example, Redmi 7), as they consume less resources.
  3. GSI firmware: General Android builds that can be installed on any device with an unlocked bootloader, suitable for experimentation, but can work unstablely.

For beginners, we recommend starting with xiaomi.eu, a stable version of MIUI without bloatware, with weekly updates. Power users often choose Pixel Experience for an interface similar to Google Pixel, or LineageOS for maximum customization. Below is a comparison table of popular firmware for Xiaomi:

FirmwareTypeAdvantagesDeficienciesSupport for models
xiaomi.euModified MIUIStability, no advertising, weekly updatesRequires unlocked bootloader, no Google services out of the boxMost of the Xiaomi/Redmi/POCO models
Pixel ExperienceAOSPGoogle Pixel interface, quick workSome functions may not work (NFC, IR-blaster)Popular models (e.g. POCO F3, Redmi Note 10 Pro)
LineageOSAOSPMaximum customization, long-term supportMinimalist design, may not have a MIUI cameraA wide list, but not all functions work
CrDroidAOSPBalance between performance and functionalityFewer updates than Xiaomi.euLimited list (mostly flagships)

Before choosing, check if there is firmware for your model on XDA Developers or 4PDA. For example, for the POCO X3 Pro there are stable builds of Pixel Experience, and for the Redmi Note 8 LineageOS 20 (based on Android 13) is better suited.

πŸ’‘

Before downloading the firmware, check its hash amount (MD5 or SHA-256) on the developer’s website. This will protect you from fake builds with viruses or miners.

Installation of TWRP Recovery: a mandatory step before firmware

TWRP (Team Win Recovery Project) is a custom recovery that allows you to install firmware, backup and restore the system. Without it, custom firmware installation is impossible. The installation process for TWRP is different for different Xiaomi models, but the overall scheme is as follows:

Download the official image TWRP for your model|Install drivers ADB and Fastboot on PC|Enable debugging on USB phone-on|Make a backup copy of the data (TWRP does not save user files)|Charge your phone at least 70 times%-->

Instructions for installing TWRP via fastboot:

  1. Download the current version TWRP for your model from the official website (for example, for Redmi Note) 9 Pro, it's gonna be a file. twrp-3.7.0_9-0-joyeuse.img).
  2. Unpack the archive from TWRP in the folder from fastboot (usually C:\platform-tools after installing the Android SDK).
  3. Connect your phone to your PC in fastboot mode (turn off the device, then press Volume Down + Power before the Fastboot logo appears).
  4. Open the command line in the folder with fastboot and execute the command: fastboot flash recovery twrp-3.7.0_9-0-joyeuse.img
  5. After successful firmware reboot in TWRP Team: fastboot boot twrp-3.7.0_9-0-joyeuse.img

If the TWRP doesn't start after the reboot and the phone loads into standard recovery, your model has Anti-Rollback protection.

  • πŸ”§ Install TWRP Fastboot boot (not flash!) and flash it right away. disable_force_encrypt.zip (Otherwise, the data will be encrypted and will not be available).
  • πŸ“¦ Download firmware and Magisk in advance to install them in one session TWRP.

⚠️ Note: Some models (e.g. Xiaomi 12 and newer) TWRP This can cause hardware-based anti-rollback to go off, making the device unsuitable for official updates.

Firmware custom OS through TWRP: step-by-step instructions

Now that you have the bootloader unlocked and you have TWRP installed, you can start installing custom firmware, and this is irreversible, and once you have the firmware, all the data on the device will be erased.

  1. Reset to factory settings: In TWRP, select Wipe β†’ Advanced Wipe and mark Dalvik, Cache, System, Data. This will delete all user data and old firmware.
  2. Install firmware: Press Install, select the downloaded firmware file (usually this is the ZIP-archive) and confirm the installation of the swipe.
  3. GApps firmware (if needed): If you install LineageOS or Pixel Experience without Google services, download the appropriate Open GApps package (choose arm64 for most Xiaomi) and run it right after the main firmware.
  4. Install Magisk (optional): If you need root access, file Magisk ZIP in the same TWRP session.
  5. Reboot: Press Reboot System. The first run can take up to 10 minutes - don't interrupt the process!

If after the reboot, the phone is stuck on the logo or went to bootloop, then the firmware is not suitable for your model or you missed the step with the Wipe.

  • πŸ”„ Go back in TWRP (Hold the volume up + Power on loading).
  • 🧹 Repeat Advanced Wipe and install the firmware again.
  • πŸ” Check if you downloaded the firmware version (for example, for Redmi Note 10 Pro there are separate builds for sweet and sweetin).
What if TWRP doesn’t see internal memory?
If TWRP It doesn't display files on the internal drive, it means the data is encrypted: 1. Connect your phone to your PC through USB mode MTP (into TWRP It's done through Mount. β†’ Enable MTP). 2. Copy firmware to your phone via computer. 3. If it doesn't help, go ahead. disable_force_encrypt.zip (look 4PDA).

On models with dynamic partitions (such as Xiaomi 11 and later), the standard Wipe method will not work. In this case, you need to manually format the userdata partition with the command. `fastboot erase userdata` before-fixing.

Solving typical problems after firmware

Even if the firmware is successful, there may be problems, and here are the most common ways to solve them:

Problem.Possible causeDecision
No network (IMEI lost)No modem or EFS sectionRestore. IMEI through QCN-Recovery or sew stock modem from the official firmware
The camera's not working.There are no drivers. MIUI Camera in AOSP-firmwareInstall ANX Camera or patch for 4PDA camera
Fast battery dischargeThe kernel or background processes are not optimizedSweep through the FrancoKernel core or calibrate the battery to TWRP (Battery β†’ Calibrate)
It's not working. NFC/IR-blasterThere is no support in the custom firmwareReturn to MIUI or look for alternative firmware with support (e.g. xiaomi.eu)

If the phone stopped seeing after the firmware SIM-check if the Baseband settings are wrong. TWRP file vendor.img Also make sure you download the firmware to properly modify the device (e.g., for Redmi Note). 9 Pro is a version for the global (joyeuse) and Indian (curtana) markets – they are incompatible!).

πŸ’‘

If the phone doesn't turn on after the firmware is done (black screen, no image vibration), try booting into TWRP and flashing the stock firmware through fastboot, which restores performance in 90% of cases.

Return to stock firmware: how to roll back

If custom firmware did not meet expectations or critical errors occurred, you can return to the official MIUI. For this you will need stock firmware in.tgz or.zip format (you can download on the official website of Xiaomi or Xiaomi Firmware Updater).

Return process:

  1. Download the full stock firmware (not a full stock firmware) OTA-update!) for your model, for example, for POCO X3 NFC It'll be a file. surya_global_images_V12.5.3.0.RJGMIXM_20220321.0000.00_11.0_global_1a2b3c4d5e.tgz.
  2. Unpack the archive and find the file. flash_all.bat (for Windows or flash_all.sh (for Linux/Mac).
  3. Connect your phone to fastboot and start the script, and it will automatically stitch all the partitions.
  4. Once completed, the phone will reboot to standard MIUI, and may require a link to a Mi Account when it first starts.

If you need to log in to Mi Account after running the firmware, but you don’t remember the data, use the Mi Account Bypass Tool (available on 4PDA), but note that this method does not work on all models and can lead to locking the device.

⚠️ Note: On some devices (e.g. Xiaomi) 12T And now, returning to stock firmware via fastboot resets the bootloader's unlock status, which means you'll have to wait another 7 days to re-install custom firmware.

FAQ: Answers to Frequent Questions

Can I install custom firmware without unlocking the bootloader?
No, it's impossible. All modern Xiaomi smartphones (since 2016) have a locked bootloader by default.The only exception is devices purchased before this policy (like the Redmi Note 3 Pro), but even those can have installation problems due to outdated TWRP versions.
How to check if the bootloader is unlocked on my Xiaomi?
Turn off the phone, then press Volume Down + Power to enter fastboot. If you see the "UNLOCKED" sign next to the rabbit logo at the bottom of the screen, the bootloader is unlocked. If it's "LOCKED," it means that unlocking is not done.
Lost IMEI after firmware.
If the network is missing and IMEI is displayed as Null or 00000000, try: Swipe modem and EFS from stock firmware via TWRP. Using the QCN Rebuilder tool (requires EFS backup before firmware). Restore IMEI through the engineering menu (code ##4636##) if the firmware supports this feature. If nothing helps, contact the service center - self-restore IMEI on some models (e.g. Xiaomi 13) can lead to hardware lock the modem.
Which firmware to choose for maximum productivity?
For weak devices (such as Redmi 8A or Redmi 9C), LineageOS is optimal without GApps – it consumes minimal resources. For flagships (such as POCO F4 or Xiaomi 12), Pixel Experience or CrDroid with the FrancoKernel core will suit. If you want a balance between stability and functionality, choose xiaomi.eu.
Can I get it? OTA-customization?
Yes, but only if the firmware supports OTA. For example, xiaomi.eu and LineageOS have an inbuilt update system. However, installing updates will require re-downloading to TWRP. Some firmware (such as Pixel Experience) require manual installation of each update.