Installing Android 12 on Xiaomi Mi 9: a detailed guide

Owners of the legendary Xiaomi Mi 9 often wonder about extending the life of their device, since official support ended with the version of MIUI 12 with the base of Android 10. However, the development community did not leave the flagship of 2019, creating many stable builds based on Android 11 and Android 12. Installing a newer operating system allows you to run current applications, get fresh security patches and enjoy the modern interface.

The upgrade process requires attention and risk understanding, as the procedure involves unlocking the bootloader and working with the Fastboot. Despite the technical difficulties, the result is worth it: the smartphone starts to work faster, and the battery holds its charge better thanks to optimizations of new versions of the kernel. In this article, we will discuss every step in detail, from tool preparation to the final configuration of the system.

Before you start manipulating the software, you need to realize that any actions you do to reflash at your own risk. Incorrectly following the instructions can lead to the failure of the device, although in the case of the Xiaomi Mi 9 (codename cepheus), the risk is minimal when following proven methods.

Preparation of the device and necessary tools

Start with a thorough preparation of the workplace and the smartphone itself. You will need a computer running Windows (preferably 10 or 11), a high-quality computer. USB-cable, preferably original or certified, with good bandwidth, and all available updates within the current firmware must be installed on the smartphone to update security components.

The critical step is to create a full backup of all data, and when you switch to custom firmware or even change the region of the official firmware, the device's memory will be completely cleared, and use Mi Cloud, Google Drive, or local copying on your PC to save contacts, photos, and documents.

β˜‘οΈ Firmware readiness

Done: 0 / 4

You also need specific tools that you should download in advance, based on the ADB and Fastboot package, which provides debugging for your computer and smartphone, without which you will not be able to interact with the Xiaomi Mi 9 system partitions.

⚠️ Warning: Make sure that the battery charge of the smartphone is at least 60-70%. Interrupting the system partition writing process due to battery discharge can damage the boot sector.

Unlocking the Bootloader bootloader

The first and mandatory step to install any informal or regional firmware is to unlock Bootloader. In Xiaomi devices, this is done officially through the Mi Unlock Tool utility. First, you need to link your Mi Account to the device in the settings menu, namely in the About Phone section, where you need to click on the MIUI version several times.

Once you have enabled the Factory Unblock option and account binding, you will have to wait a certain period of time, usually 7 days (168 hours), but in some cases the timer can be increased to 30 days, a company security measure to prevent device theft and malware installation.

  • πŸ”“ Turn on the developer mode by clicking 7 times on the build number in the About Phone menuΒ».
  • πŸ“± In the menu "For developers" activate the item "Factory unlock" and link the account.
  • ⏳ Wait for the waiting period set by the system (from 7 to 30 days).
  • πŸ’» Run Mi Unlock Tool on PC and unlock in Fastboot mode.

After the wait period expires, turn the smartphone into Fastboot mode, holding the power and volume buttons at the same time. Connect the device to the PC and start the unlock program. The process will take a few seconds, after which the phone will be cleaned and the bootloader will be open for modifications.

What to do if Mi Unlock is writing an error?
If the utility gives an error in communication with the server or timer, try using mobile Internet (distribution from the phone) instead of Wi-Fi, as IP-Mobile phone addresses are less likely to be blocked by Xiaomi filters, and sign-in to the Mi Community app helps before trying to unlock it.

Choosing the Right Android 12 Firmware

There are several ways to get Android 12 for Xiaomi Mi 9. Xiaomi has not officially released a global version of MIUI 13/14 based on Android 12 for this model in all regions, but for the Chinese version (CN), such updates have been released. Global users often install Chinese firmware with subsequent localization or choose custom builds.

The most popular custom solutions are LineageOS, Pixel Experience (or its forks) and Xiaomi.eu. Xiaomi.eu firmware is a modified Chinese version of MIUI with cut-out Chinese services, added multilingual and optimizations. This is the best choice for those who want to keep the familiar MIUI interface, but get a fresh Android.

If you prefer pure Android, you should pay attention to the builds LineageOS 19. they provide maximum performance and autonomy, lack of unnecessary software, but may have some limitations in the functionality of the camera compared to the runoff.

Type of firmwareBasisStabilityFor whom?
Xiaomi.euMIUI (China)Tall.Fans of MIUI interface
LineageOSAndroid AOSPMedium/HighConnoisseurs of pure Android
Pixel ExperienceAndroid AOSPTall.Fans of Google Pixel
Official GlobalMIUIMaximumAndroid 10 only (stack)

Download firmware images should only be from trusted sources: the official forum XDA Developers, the site Xiaomi.eu or the repositories Telegram known developers. Using files from dubious sources can lead to infection of the device malware viruses.

πŸ“Š Which interface do you prefer?
MIUI with widgets
Pure Android (AOSP)
The shell of OnePlus OxygenOS
I'm staying on the old version.

Installation process via Fastboot

Installing firmware through Fastboot mode is the most reliable method, as it allows you to completely rewrite all memory partitions, eliminating file conflicts of the old system. ADB/Fastboot.

After unpacking the archive with the firmware, you will see a file with the.bat extension (for Windows), which is usually called the file. flash_all.bat or flash_all_except_storage.bat. The second option is preferable as it does not erase internal memory, although data cleanup is still recommended for stability.

fastboot flash boot boot.img


fastboot flash system system.img




fastboot flash vendor vendor.img




fastboot reboot

However, manually entering commands is not necessary if you are using a script installer. flash_all_except_storage.bat on behalf of the administrator, first transferring the smartphone to Fastboot mode (pressing power and volume down) and connecting it to the PC.

⚠️ Attention: Do not turn off the cable USB And don't interrupt until "Finished" appears, and interrupting the system or vendor partition entry is guaranteed to lead to a brick in the device.

The entire process takes 5 to 10 minutes, and once it is complete, the smartphone will automatically restart, and the first download can take longer than usual, up to 5-7 minutes, as the system optimizes applications and creates cache.

πŸ’‘

Use of script flash_all_except_storage.bat β€” The safest method for beginners, as it minimizes the risk of human error when typing commands.

Installation through Recovery (TWRP)

An alternative method involves the use of custom recovery, most often TWRP (Team Win Recovery Project), which is convenient because it does not require a constant connection to the computer and allows you to install firmware directly from the memory card or internal storage. For the Xiaomi Mi 9, there is a stable version of TWRP that supports data encryption.

First, you need to install the Recovery itself. This is done via Fastboot by the fastboot flash recovery command twrp.img, where twrp.img is the recovery image file. After the firmware is installed, you need to immediately go to Recovery mode, holding the power and volume buttons up to prevent the system from booting and overwriting the recavereas back to stock.

  • πŸ“₯ Copy the firmware zip archive and GApps (if needed) to your phone or SD-map.
  • 🧹 On the menu. TWRP Choose the Wipe β†’ Format Data and enter β€œyes” for complete cleanup.
  • βš™οΈ Go to Install, select the firmware archive and confirm the installation by swipe.
  • πŸ”„ After installation, select Wipe Cache/Dalvik and then the Reboot System.

An important nuance when installing Android 12 via TWRP is the need to format the data partition, which is due to changes in encryption policies in new versions of Android. If you just do "Wipe", the system may not start or enter a reboot cycle.

If you install custom firmware based on AOSP (like LineageOS), be sure to flash GApps (Google Apps) if it isn't built into firmware. Without this step, you won't have access to the Play Market and Google services.

Solving problems and mistakes

When installing Android 12 on Xiaomi Mi 9, users may encounter a number of specific problems, one of the most common is a broken camera or poor image quality, which is because the camera drivers in custom firmware may differ from stock ones. The solution is to install GCam (Google Camera) with a suitable configuration.

Another problem is the β€œVerification failed” error when booting, which means that the integrity of the bootloader is compromised, which is normal for unlocked devices. To hide this message or bypass the check, you sometimes need to patch the vbmeta image or use a special command in Fastboot: fastboot. --disable-verity flash vbmeta vbmeta.img.

⚠️ Note: Some banking applications may refuse to work on devices with an unlocked bootloader. To circumvent this limitation, you will need to install Magisk and root rights concealment modules (Zygisk, Shamiko).

It can also overheat the device in the first hours of use, and it does file indexing and optimization, which loads the Snapdragon 855 processor, and usually resolves the problem by itself after 1-2 charging and discharging cycles.

πŸ’‘

If after firmware touch screen is not working correctly (skip presses), try in the engineering menu or through ADB command to calibrate the touch screen, or reflash the persist section.

Frequently Asked Questions (FAQ)

Is it safe to put Android 12 on Xiaomi Mi 9?
Yes, if you use stable builds from trusted developers (Xiaomi.eu, LineageOS), however, remember that this deprives you of warranty (if it was still in force) and carries minimal risks of damage to the software if you violate the instructions.
Can I use NFC and pay after I have been firmware?
In most builds Xiaomi.eu and LineageOS NFC works out of the box. Paying through Google Pay (or Wallet) on custom firmware may require additional Magisk customization to hide superuser rights.
Can I return to the official Android 10 firmware?
Yes, you can always come back. You need to download the official global firmware for the Mi 9 and flash it through Fastboot with complete data clearing, and the bootloader will remain unlocked unless you specifically close it through Mi Unlock.
Will the autonomy on Android 12 be reduced?
At first, autonomy may be lower due to optimization processes. In the long run, Android 12 often runs even more cost-effective than older versions due to improved background management, but the result depends on the specific firmware build.