The forgotten digital code on Xiaomiβs smartphone is a problem that thousands of users face every day, unlike a pattern lock or a fingerprint, PIN-The code blocks access to all device functions, including calls and SMS. But donβt panic: There are at least 5 working ways to unlock, and most donβt require special skills.
It is important to understand that the methods differ depending on the version of MIUI, the phone model (Redmi Note 12, POCO X5, Mi 11, etc.) and whether the device is linked to the Mi Account. In this article, we will discuss all the current methods - from official (through access restoration) to technical (using fastboot and ADB), and you will learn how to avoid data loss and what to do if the phone requires confirmation after a reset.
Warning: some methods lead to a complete memory cleanup. If your device stores important data, try the options without resetting first. And remember, the newer Xiaomi model, the harder it is to bypass security due to the improved security protocols in MIUI 14/15.
1 Unlocking through Mi Account (official method)
The most reliable and recommended method Xiaomi is to restore access through an attached Mi Account, which works if:
- π± The phone is connected to the Internet (Wi-Fi or mobile network).
- π Remember the username and password from Mi Account.
- π Synchronization is enabled on the device (checked in the account settings).
Instructions:
- On the lock screen, click Forgot Password? (or Forgot Password? on English firmware).
- Choose Restore through Mi Account.
- Enter the email or phone number associated with the account.
- Confirm the entrance through SMS-code.
- Create a new one. PIN-code.
If the option is forgotten password? is missing, it means:
- π« The phone is disabled synchronization with Mi Account.
- π No Internet connection (check if the network indicator is on).
- π§ The device is operated by custom firmware (unofficial).
β οΈ Note: After 5 failed attempts to enter a password, Xiaomi can block the ability to restore through Mi Account for 24 hours.
2.Reset via Recovery Mode (Hard Reset)
Hard reset is a universal way to unlock, but it removes all data from the device, including photos, contacts and apps, and is suitable for Redmi, POCO and Mi models on any version of MIUI.
Step-by-step:
- Turn off the phone with a long press on the power button.
- Click the combination: For most models: Power button + Volume up. For older devices (Redmi 4X, Mi A1): Power button + Volume up + Volume down.
Mi
Recovery Mode
Wipe Data
Clear Data
Wipe All Data
Reboot
βοΈ Preparation for Hard Reset
After restarting, the phone will require:
- π Data entry from Mi Account if it was linked.
- π± Configure as a new device (language selection, Wi-Fi connection, etc.).
β οΈ Note: On devices with Qualcomm Snapdragon chip (e.g, POCO F5, Redmi Note 12 Pro+) Hard Reset may cause a "This device is locked" error, which means that the phone is tied to a Mi Account and you can't unlock it without it.
3. Unlock through ADB (for advanced users)
The Android Debug Bridge (ADB) method is suitable if the phone is enabled with USB debugging and has access to the computer.
What you need:
- π» A computer with installed Xiaomi drivers and ADB Tools.
- π USB-cable (original, without damage).
- π± Phone with debugging enabled (configured in Settings) β The phone. β Version. MIUI β 7 times to unlock the developer menu).
Instructions:
- Connect your phone to your PC via USB.
- Open the command line (Win + R β cmd) and type: adb devices If the device appears in the list, go further.
- Enter the commands in turn: adb shell su rm /data/system/gesture.key rm /data/system/password.key rm /data/system/locksettings.db rm /data/system/locksettings.db-wal rm /data/system/locksettings.db-shm reboot
- After restarting, the phone will unlock.
What if the ADB canβt see the device?
If after execution of commands the phone still requires a password, it means:
- π The device uses hardware encryption (starting with the MIUI 12).
- π± No root rights (the su team did not work).
4.Use of the Find Device service (remote unlock)
Xiaomi offers the official Find Device service, which allows you to unlock your device remotely.
- π The phone includes geolocation and mobile Internet.
- π The device is tied to the Mi Account.
- π Battery level above 15%.
How to unlock:
- Go to i.mi.com and log in.
- Select a locked phone from the list of devices.
- Press Find the device. β Unlock.
- Confirm the action via SMS or email.
- Wait for a notification of successful unlocking (can take up to 5 minutes).
Limitations of the method:
- π« It does not work on devices with the Internet off.
- π After unlocking, you may need to re-enter the password from the Mi Account.
- π± In some models (POCO X3 Pro, Redmi K50) default.
π‘
If Find Device does not find your device, check if the device search option is enabled in the security settings (Settings β Memory and Security β Device search).
5. Unlock via Fastboot (for tech-savvy)
The Fastboot method is suitable for devices that have OEM Unlock protection turned off (usually models until 2020), which requires unlocking the bootloader and leads to a complete data reset.
What you need:
- π» Computer with Mi Flash Tool and drivers installed.
- π Original. USB-cable.
- π Firmware for your model (download from the official website).
Step-by-step:
- Turn off your phone and put it into Fastboot mode: Press Power Button + Volume Down. Connect to your PC - should be defined as a Fastboot device.
Mi Flash Tool
Refresh
Clean All
Flash
On Xiaomi models 2021-2026 (e.g. Redmi Note 13, POCO F6), unlocking the bootloader requires confirmation via Mi Account and waiting 7-15 days after filing an application.
β οΈ Warning: Continuous interruption of the firmware process via Fastboot can cause a device to "break down." If the process indicator is stuck 99% longer than 10 minutes, do not turn off the cable - wait for the automatic restart.
6. Alternative methods (for specific cases)
If standard methods donβt work, try these options:
| Method | Conditions | Risks. |
|---|---|---|
| Reset via EDL Mode | You need an authorized Xiaomi developer account and a special cable. | High risk of IMEI blocking. |
| Use of TestPoint | It's good for the Redmi 5/6/7 series, so you need to close contacts on the board. | Requires disassembly of the phone, risk of damage. |
| Contacting the service center | If the phone is warranty or data retention is required. | Paid service (from 1000 to 5000) β½). |
| FRP Bypass exploit | It works on older versions of MIUI (up to 11th). | It might not work the first time. |
For methods with disassembly of the phone (TestPoint, EDL), we recommend contacting specialists. Wrong actions can lead to:
- π₯ Battery overheating.
- π΅ Poose. IMEI (The phone won't catch the network).
- π Complete failure of the motherboard.
π‘
If the phone is locked after buying from hands, check it for binding to other accounts through the service Mi Verify. Devices with active binding to the Mi Account of the previous owner can not be unlocked without his data.
Frequent mistakes and their solutions
When you unlock digital code on Xiaomi, users face typical problems.
"This device is locked after Hard Reset"
The error appears on devices with Mi Account tied.
- π Enter the account that was linked to the phone.
- π§ If you forget your password, restore it through account.xiaomi.com.
- π If you have purchased your phone from hand, contact the previous owner.
ADB does not see the device
Connection problems are solved as follows:
- π Check the cable (use the original from Xiaomi).
- π₯οΈ Reinstall drivers via Mi PC Suite.
- π Turn on/off debugging on USB developer-setting.
The phone is not included in Recovery Mode
Possible causes:
- π Battery discharged (charge to at least 30%).
- π§ Faulty buttons (try to connect the keyboard on the OTG).
- π± Device "bricked" (requires firmware through the EDL).