How to unlock a Xiaomi smartphone: from a pattern lock to a Mi Account

Did you forget your Xiaomi password or did your phone get locked after a failed entry attempt? The situation is familiar to many β€” according to statistics, 28% of users have at least once faced a smartphone lock. Fortunately, you can unlock Xiaomi (including the Redmi Note 12, POCO X5, Mi 11 and others) in several ways β€” from standard MIUI functions to engineering modes.

In this article, we will discuss 5 working ways to unlock, including bypassing the pattern lock, resetting via Fastboot, unlocking the Mi Account and even methods for devices with a damaged screen. All instructions are relevant for MIUI 12-14 and tested on models from 2020-2026. Importantly, some methods require preliminary preparation (for example, enabled debugging over USB), so read carefully!

1 Unblocking through Mi Account (official method)

If your Xiaomi is tied to a Mi Account, it’s the easiest and safest way to unlock, and it works even after a hard reset if the device has been synced to Xiaomi’s servers.

  • πŸ”‘ Enter any password/key 5 times in a row until the message β€œForgot password?” or β€œUnlock via Mi Account” appears".
  • πŸ“§ Click on the link and enter email/phone linked to your account, and it'll have a confirmation code.
  • πŸ”„ Enter the code and follow the instructions on the screen. The phone unlocks without losing data.
  • ⚠️ If the device is not connected to the Internet, use SIM-mobile traffic card or connect to Wi-Fi via notification panel (if available).

Limitations of the method:

  • ❌ It does not work if your Mi Account is not linked to your phone.
  • ❌ On some models (e.g. Redmi) 9A) Confirmation is required through SMS, Even if the email is correct.
  • ❌ After 3 failed attempts to enter the code, the system can block the unlock for 24 hours.

πŸ’‘

If you don't remember an email from Mi Account, check the emails with the subject line "Xiaomi Account Registration" or "Mi Account Verification." Often the username is listed there.

2. Reset the pattern lock via a call (for MIUI 12 and older)

This works on most Xiaomi smartphones with MIUI 12-14 firmware and does not require a computer, and the method is to exploit a vulnerability in the emergency call interface. Importantly, after the security update in 2023, the method stopped working on the POCO F5 and Redmi Note 12 Pro+.

  1. On the lock screen, click "Emergency Call".
  2. Enter the combination ##4636## (test menu). If it doesn't work, try #7780###.
  3. In the menu that opens, select "Settings" β†’ "Recovery and Reset".
  4. Reset the pattern lock via "Delete password" (the data will not be deleted).

If the combinations don’t work, try an alternative path:

  1. In an emergency call, dial any number (e.g. 112).
  2. Click on the Contacts icon (if available).
  3. Add a new contact and enter 10-15 spaces in the name field, then save.
  4. Return to the contacts screen, copy the created contact and paste it into the search bar – this can cause the interface to crash and open access to settings.
πŸ“Š Xiaomi has been blocked because of
Forgotten password
pattern lock
Mi Account Account
Other causes

3. Unlock via Fastboot (for advanced users)

If the previous methods didn't work, you'll have to use Fastboot mode, which requires a computer, a USB cable, and ADB/Fastboot drivers installed.

What you need:

  • πŸ–₯️ Computer with Windows/Linux/macOS.
  • πŸ”Œ Cable USB (preferably original).
  • πŸ“¦ Archives from Platform Tools (from Google).
  • πŸ”§ Drivers for Xiaomi (download from the official website).

Step-by-step:

  1. Turn off the phone. Press the Power button + Volume down to enter the Fastboot.
  2. Connect your phone to your computer. Open the command line in the Platform Tools folder.
  3. Check the connection command: fastboot devices should appear serial number of the device.
  4. To unlock the bootloader (if not unlocked) enter: fastboot oem unlock Attention: this will erase all data!
  5. If the bootloader is already unlocked, run the stock firmware command: fastboot flash all [name file firmware.zip]
What if the fastboot can’t see the device?
1. Check the cable and USB port (try another one). 2. Install the drivers manually through Device Manager (select "Xiaomi Composite MDB Interface"). 3. Disable the driver signature in Windows (reboot in debugging mode for this). 4. Try another computer.

Warnings:

⚠️ Warning: Unlocking the bootloader via fastboot oem unlock results in a complete reset and deletion of all data, including photos and apps. If the phone has backups of Mi Cloud enabled, you can restore the data after unlocking.

⚠️ Note: Some models (e.g. Xiaomi) 13T) After unlocking the bootloader, Anti-Rollback protection can work, which will lock the phone if you flash the old version. MIUI. Always use the latest official firmware.

4. Bypassing the lock via ADB (if debugging is enabled)

If your Xiaomi has USB debugging enabled before locking, you can unlock your phone without losing data. This works on MIUI 13-14 and requires a computer.

Preparation:

β˜‘οΈ What to check before using ADB

Done: 0 / 4

Instructions:

  1. Connect the phone to the computer.
  2. Open the command line and check the connection: Adb devices should appear with the status of authorized.
  3. Delete the file with the password / key: adb shell rm /data/system/gesture.key or PIN-code: adb shell rm /data/system/password.key
  4. Reboot your phone: adb reboot

After the reboot, the pattern lock or PIN will reset, but all the data will remain in place. If the command does not work, try an alternative method:

adb shell


su




rm /data/system/locksettings.db




rm /data/system/locksettings.db-wal




rm /data/system/locksettings.db-shm




reboot

πŸ’‘

The ADB method is the only way to unlock Xiaomi without losing data, but it only works if USB debugging was enabled before locking.

5 Unlocking through Xiaomi Service Center

If all the previous methods did not work, you just have to contact the official Xiaomi service center, which is the most reliable, but also the longest way.

  • πŸ“„ Bring your purchase document (check, warranty card) and passport, without which you may refuse to unlock.
  • πŸ’° The cost of the service varies from 500 to 2000 rubles, depending on the model and the reason for the lock.
  • ⏳ The unlock period is from 1 to 5 working days (some cities have express service for 2-3 hours).
  • πŸ”„ The service may offer a complete reset or flashing, which will lead to data loss.

How to find the official service:

  1. Go to the Xiaomi Service website.
  2. Choose a country and a city.
  3. Check the reviews about the service center (some "official" partners work in bad faith).

The alternative is informal services that offer unlocking via engineering firmware or EEPROM readers, but the risks are high:

  • ⚠️ Possible installation of pirated software or viruses.
  • ⚠️ Phone Warranty Burns After Unofficial Intervention.
  • ⚠️ On new models (such as Xiaomi 14), such methods can lead to hardware locking. IMEI.

Comparison of Xiaomi Unlocking Methods

MethodPC requiredData retainedDifficultyWorks on
Through the Mi Account.❌ No.βœ… Yes.⭐All models with MIUI
Emergency call.❌ No.βœ… Yes.⭐⭐MIUI 12–13 (not running on POCO F5, Redmi Note 12 Pro+)
Fastbootβœ… Yes.❌ No (full reset)⭐⭐⭐⭐All models, but require unlocking the bootloader
ADBβœ… Yes.βœ… Yes.⭐⭐⭐Only if USB debugging is enabled
Service centre❌ No.❌ Depends on the method.⭐All models.

Frequent Mistakes and How to Avoid Them

When you unlock Xiaomi, users often face typical problems, and here are the most common ways to solve them:

  • πŸ”Œ "Fastboot doesn't see the device": Check the cable (use the original from Xiaomi). Install the drivers manually through Device Manager. Try another one USB-port USB 2.0).
  • πŸ”’ "Mi Account does not accept password": Check the keyboard layout (password can be entered in English). reset your account password via Xiaomi website. If your account is blocked, contact support with a photo of your check on your phone.
  • πŸ“± "After Fastboot reset, the phone won't turn on": Check if you downloaded the correct firmware (should match the model and region). Try flashing only the boot partition instead of the full firmware. If the screen is black, wait 10-15 minutes - sometimes the first download takes a long time.

Tips for the future: To avoid unlocking issues, set the following settings in advance on Xiaomi:

  • πŸ” Enable Smart Lock (Settings) β†’ Screen locking β†’ Smart Lock and add reliable devices (such as smartwatches or home Wi-Fi).
  • ☁️ Activate backup in Mi Cloud (photos, contacts, SMS).
  • πŸ”§ Put the debugging on. USB (Even if you don’t plan to use it).
  • πŸ“ Write down your Mi Account password in a secure location (for example, in a password manager).
Can you unlock Xiaomi without losing data if USB debugging is not enabled?
Unfortunately, no. Without USB debugging enabled or a Mi Account tied, all unlocking methods will result in a data reset, and the only chance is to go to a service center, but there's no guarantee that files are safe.
Why does the phone ask for a password again after unlocking via Fastboot?
This happens if you have flashed the wrong version of MIUI or have not deleted your password files (gesture.key, password.key).Solution: Log in to Fastboot again. Fastboot full-reset stock firmware. If it doesn't help, delete your password files via TWRP (requires an unlocked bootloader).
How to unlock Xiaomi if the screen is broken and does not respond to touch?
There are two options: Connect your mouse via USB-OTG (if the screen displays a little bit of the picture); once you connect with the cursor, you can enter your password or go to settings; use ADB/Fastboot (if debugging was enabled); connect your phone to your PC and execute commands to reset your password (see ADB section). If the screen is completely black, then only the firmware is left over via Fastboot or the service center.
What if Xiaomi says, β€œThis device is linked to another Mi Account” after unlocking?
This means that the phone was linked to another Mi Account (e.g. if you bought a used one).Solutions: Ask the previous owner to remove the device from your Xiaomi account. If you cannot contact, contact Xiaomi with a check to buy. On some models, resetting via Fastboot with full cleaning (fastboot erase userdata) helps). ⚠️ Warning: Buying phones with a Mi Account tied carries the risk of being blocked.Always check your account status before buying a used device!
Can you unlock Xiaomi with TWRP?
Yes, if the phone has a custom TWRP recap and the bootloader is unlocked. Instructions: Log in to TWRP (press Power + Volume Up). Go to Advanced β†’ File Manager. Delete files: /data/system/gesture.key /data/system/password.key /data/system/locksettings.db Reboot the phone. Important: Installing TWRP on new models (Xiaomi 13/14, Redmi Note 12) can trigger Anti-Rollback and lock the device!