Developing Android on Xiaomi devices requires a special approach: the manufacturer actively protects its smartphones from unauthorized changes, which creates additional barriers to testing applications and debugging. Unlike the naked devices Google Pixel or Samsung with an open bootloader, you will have to go through unlocking Bootloader, activating hidden functions and configuring ADB with the features of the MIUI firmware.
This article is not about "how to turn on debugging". USB" β These instructions have long since lost their relevance. We will explore the unique nuances of working with Xiaomi in 2026, including bypassing restrictions on unlocking the bootloader, optimizing performance for emulating low-level operations and solving typical problems with fastboot on new models (Redmi Note 13 Pro).+, POCO F6, Xiaomi 14 Ultra.Be prepared for the fact that the process will take from 30 minutes to several days β it all depends on the model and version. MIUI.
1. Device preparation: compatibility check and backup
Before touching system settings, make sure your Xiaomi device supports unlocking the bootloader at all. Since 2022, the company has tightened its policy: some models for the Chinese market (China ROM) are physically locked from unlocking, even if you get permission through the Mi Unlock Tool.
Check the possibility of unlocking can be in two ways:
- π Enter the dialing field code ##7378423## β Go to the Service Provider β Device Unlock Status: If you have Locked status but you have an Add account button, you can unlock the device.
- π± Install the Mi Unlock Status app (available on APKMirror) to show the current bootloader status and approximate unlock waiting time.
If Unlock Disabled status is a restriction (e.g. Redmi Note 12 Pro Speed Edition for China), then Globalβs firmware is the only way out. ROM through EDL-Mod (we will talk about it in section 5).
β οΈ Attention: Starting with MIUI 14, backup via Mi Cloud does not store root application data. If you plan to get root access, use Swift Backup or Titanium Backup (requires Magisk).
Minimum checklist before starting work:
Link your Mi Account to your device (required!)
Download the latest version of the Mi Unlock Tool from the official website
Make sure that the PC has ADB/Fastboot drivers installed (version no lower than 33.0.3)
Disable all antiviruses (they block fastboot commands)
Charge your phone at least 60% (unlocking at low charge will be interrupted)
-->
2. Activation of Developer Mode and Hidden MIUI Functions
Enabling developer mode on Xiaomi is different from standard Android because of the MIUI shell. The classic method (7 taps by build number) works, but only gives access to basic settings. To get full control, you need to:
- Go to Settings β About Phone β MIUI version and tap 7 times on the line with the version. the notification will appear "You became a developer".
- Return to the main settings menu β find a new section Additional β For developers.
- Activate: π§ Debugging by USB (Allow debugging for your PC on the first connection) π Unlocking OEM (The most important point - without it, Mi Unlock Tool will not work) π‘ Do not turn off the screen during charging (useful for long sessions) ADB)
On the new versions of MIUI 14/15, some options are hidden.
- In the "For developers" section, tap three dots in the upper right corner β Show hidden settings.
- There will be an additional block with options like Force GPU Rendering or Disable HW Overlays β they are useful for testing the performance of applications.
β οΈ Attention: POCO F5 Xiaomi 13T After activation of the developer mode, access to the NFC In some banking applications (e.g. Sberbank Online), this is due to security policy. MIUI β Before testing payment services, turn off the developer mode.
To speed up work with ADB, we recommend to include:
settings put global adb_wifi_enabled 1
settings put global development_settings_enabled 1These commands activate ADB over Wi-Fi and ensure that the developer settings donβt reset after the reboot.
Redmi Note 12/13 Series
POCO F4/F5/F6
Xiaomi 13/14 Series
Another model
I haven't bought it yet.-->
3. Unlock the bootloader: bypassing the restrictions of Xiaomi
This is the most difficult step. Xiaomi requires an account to be linked to a device and waits (from 72 hours to 7 days) before unlocking.
- Download Mi Unlock Tool from the official website (the version must match the region of your Mi Account).
- Sign in to the tool under the same account as on the phone.
- Connect your phone in Fastboot mode (press Power + Volβ when the device is off).
- In Mi Unlock Tool, press Unlock. If you have a waiting message, you will have to wait (the deadline is displayed in hours).
Step-by-step instructions for installing TWRP:
- Download the image of the recap for your model (for example, twrp-3.7.0_12-vayu.img for POCO F3).
- Restart your phone to fastboot and execute the command: fastboot flash recovery twrp.img fastboot boot twrp.img
- In TWRP, make a persistent backup (it is responsible for IMEI and communication modules!).
- Install Magisk (the latest version of Delta or Canary) via Install β Select Storage.
After the reboot, check the root status with the command:
adb shell su -c "id"If the output contains uid=0(root), the rights are obtained successfully.
β οΈ Note: Xiaomi with MediaTek processors (e.g. Redmi Note) 12) Magisk installation can break Widevine's work L1, Why Netflix and Disney are+ They will show the video in resolution. 480p. The solution is to flash Widevine Fix module through Magisk. π‘After installation TWRP The phone is loaded into the recavator instead of the system, execute the command fastboot flash recovery. stock_recovery.img, And then you're loading into TWRP via fastboot boot twrp.img. This bypasses the problem of overwriting the Recovery on some models. 5. Setting up ADB and optimization for debugging applications Standard commands ADB Xiaomi is working with restrictions due to the policy MIUI. For example, an attempt to obtain an adb logcat may give an empty output if no special flags are activated. To unlock full access: Enable in the developer settings: π Allow debugging by USB (security) π Disable control MIUI (Disable MIUI Optimization β This will remove unnecessary restrictions on background processes π Enable Logging to get advanced logs Install Scrcpy for remote screen control from PC β it is more convenient than the standard adb shell screenrecord. ADB (without cable) run: adb tcpip 5555 adb connect 192.168.x.x:5555 Where 192.168.x.x β IP-If adb devices can't see the device, check it: π Cable - Use the original cable USB-C (Cheap cables often don't transmit data). π₯οΈ Drivers β Remove old ones through Device Manager and install Google USB Driver from Android SDK. π± Connection mode β in the notification curtain, select File Transfer (MTP), It's not just charging. To test the performance of applications, commands are useful: # Monitoring CPU/GPU Real-time adb shell dumpsys gfxinfo [application package] Activity adb shell am start time measurement -W [package]/.[Activity] | grep TotalTime Simulation of low memory (for testing leaks) adb shell am broadcast -a android.intent.action.TRIM_MEMORY -e level 15 π‘On Xiaomi with Snapdragon processors 8 Gen 2/3 (for example, Xiaomi 13 Ultra) debugging through ADB It can be lagging due to active cooling. Turn off Game Turbo in the settings to avoid artificial trottling. 6. Typical Problem Solving: From Brick to Error ADB Even with the exact following of the instructions with Xiaomi, you can experience non-standard errors: 6.1. Symptoms: The phone vibrates when you press the power button, but the screen is black, or it only boots into fastboot. Solution: Try booting into the power button. TWRP via fastboot boot twrp.img And restore the backup. TWRP Does not work β run the original firmware through the Mi Flash Tool in Clean All mode. 12) use SP Flash Tool with scatter.txt file. 6.2. The "Invalid" error IMEI" After installing custom firmware Cause: damage to the nvram partition or persist. Solution: Restore the backup persist from TWRP. If there is no backup, then go ahead and run the original. persist.img Fastboot Flash Continue persist.img. For recovery. IMEI Use the engineering menu (##36446337##) Maui META (MediaTek only). 6.3. ADB Can't see the device on Windows 11 The problem is often related to driver signatures. Solution: Disable driver signature verification: bcdedit /set testsigning on bcdedit /set nointegritychecks on Install LibUSB driver via Zadig (select Android Bootloader Interface). Restart your PC and phone. If the problem persists, check if the antivirus is blocking access (for example, Kaspersky or Avast often delete adb.exe as a "suspicious file"). 7. Optimizing Xiaomi for app testing For developers testing apps on Xiaomi, it is critical to disable background restrictions MIUI, And what you do is you do the following: π« Shut down the battery. β Optimizing the battery for your application. π In the developer settings, activate: Do not limit background processes MIUI (Removes unnecessary restrictions on multitasking 4x MSAA (for testing graphics in games) π΅ Add the application to No restrictions through Settings β Annexes β Permits β Autostart. To emulate different network conditions, use: # Network Speed Limitation (2G) adb shell svc wifi setCountryCode US; svc wifi setBand 2.4g; settings put global captive_portal_detection_enabled 0 Simulation of bad signal adb shell svc wifi setTxPower 1 If you are testing geolocation services, turn off optimization GPS into MIUI: settings put global gps_enable_hardware 0 This will force the system to use pure Android. GPS Xiaomiβs proprietary algorithms that can distort coordinates. 8. Alternative methods: EDL, If the standard unlock through the Mi Unlock Tool does not work (for example, because of the model only for China), radical methods remain: 8.1. EDL (Emergency Download Mode Requires: Authorized Xiaomi account with rights EDL (cost ~$5β$20 in the forums). Cable EDL (Or, you know, Test Point pins on the board. Mi Flash Pro or QFil (for Qualcomm). EDL (Close Test Point or use the adb reboot edl command if unlocked OEM). In Mi Flash Pro, select Fastboot firmware ROM and press Refresh β the device should be defined as COM-port. Swipe with the option Clean All and Lock (if you just need to restore the system) or Clean All (if you plan to further unlock the bootloader. Using Dongle to bypass locks For models like Xiaomi 12S Ultra or Mix Fold 3, where unlocking is officially prohibited, use hardware Dongle modules (for example, Xiaomi Authorized Unlock Dongle), which emulate the authorization of Xiaomi servers and allow you to unlock the bootloader without waiting. $30, but it only works with specific models (the list of supported devices should be specified from the seller). β οΈ Attention: Use EDL or Dongle without an authorized account can cause hard-brick if you flash incompatible firmware (ARB) Your device before the firmware! π‘If you are developing applications for Xiaomi based on HyperOS (new firmware after the MIUI 15), note that some of the ADB-commands (for example, to control brightness) may not work. Use alternative methods via Settings.Secure or WindowManager. FAQ: Frequent questions on setting up Xiaomi for development Can you unlock a bootloader on Xiaomi without waiting 7 days? Officially not. But there are workarounds: Use Dongle (hardware module to bypass locks). ROM through EDL, If your model supports region change, buy a Mi Account with a wait that has already passed (risky - can be banned, POCO F5) Waiting is reduced to 24 hours. Why did banking applications stop working after Magisk was installed? Banking applications (e.g. SberBank Online or Tinkoff) Detect root via SafetyNet or Play Integrity API. Solutions: Install MagiskHide Props Config and activate Hide Magisk. Use Shamiko or Universal SafetyNet Fix (for newer versions of Play Services). HyperOS may require a rollback to MIUI 14, as new firmware blocks Integrity bypass API. How to return the original firmware after experiments with custom ROM? To recover stock firmware: Download Fastboot ROM For your model from the Xiaomi Firmware Updater site. Unpack the archive and swipe through the Mi Flash Tool with the Clean All option. EDL (After the firmware is installed, the bootloader will remain unlocked. To block it back, do: fastboot oem lock. β οΈ This will erase all data and could lead to bootloop if the firmware isn't original! which Xiaomi models are best suited to develop in 2026? Recommended models (taking into account the price/opportunity ratio): Model PlusesMinuses POCO F5Snapdragon 7+, Unlocking without waiting, good support TWRPMidscreen (AMOLED, but 120Hz Redmi Note 13 Pro+Dimensity 7200 Ultra, 120W Low-cost charging problems with Widevine L1 after unlocking Xiaomi 13TDimensity 8200, a great camera to test ARHoney, it's hard to find. TWRP Xiaomi Pad 6 Ideal for Tablet Interface Testing, 144HzN Slot SIM, trouble GPS Avoid models on MediaTek Helio G (e.g. Redmi) 12C) β They have little support for custom firmware. Can you develop it on Xiaomi without unlocking the bootloader? Yes, but with serious limitations: β It's working. ADB (debugging, logging, installation APK). β You can test applications in Android Studio. β Impossible: Install custom Recovery (TWRP). Get root. Modify system files. Switch custom ROMs (like LineageOS) for most development tasks (except for low-level ones), unlocking is optional.