Forgot the pattern lock on Xiaomi and can't unlock the phone? This problem is familiar to many users, especially if the device has been unused for a long time or the password was entered automatically. PIN-In the case of a code or fingerprint, a pattern lock is more difficult to recover from memory β it is easy to forget, but difficult to pick up by brute force.
In this article, we will look at all the current ways to reset the pattern lock on Xiaomi, Redmi and POCO smartphones, from official methods with minimal data loss to radical solutions like hard reset. It is important to understand that not all options will suit your model: for example, on new devices with MIUI 14+ and Android 13+, some loopholes are closed. We will indicate which methods work on modern firmware and which only on old ones.
Before you start, check:
β Do you have a backup of your data (e.g., in Mi Cloud or on your computer)?
β Is your phone connected to your Mi Account?
β Is there access? SIM-card SD-map installed in the device?
The answers to these questions will help you choose the best way to unlock.
1 Unlocking through Mi Account (official method)
The most secure and recommended method for Xiaomi is to use a tied Mi Account, which works on most models if:
- π± The phone is connected to the Internet (Wi-Fi or mobile data).
- π Mi Account was activated on the device before blocking.
- π On the lock screen there is a button "Forgot your password?" (on some firmware it is not available!).
If these conditions are met, follow the instructions:
- On the lock screen, tap on "Forgot Password?" (or "Forgot pattern?" on English firmware).
- Enter the email or phone number associated with the Mi Account.
- Confirm the login via SMS or email (the code will come to the linked number / mail).
- Create a new pattern lock or PIN-code.
Important: If you don't have a "forgot password?" button, it means your model has disabled it, and it won't work if you:
- π« The device is not connected to the network (no Internet connection).
- π« Mi Account is not tied in advance.
- π« The phone was bought from hand and the previous owner did not untie the account.
2. Reset the pattern lock via Recovery Mode (without loss of data)
If Mi Account doesnβt work, you can try resetting the key through Recovery, which works for many Xiaomi models. MIUI 10β13, but requires the presence of SD-card OTG-flash-cable.
Instructions:
- Turn off the phone with a long press of the power button.
- Press Volume Up + Power before the Mi logo appears (this is the launch of Recovery Mode).
- Select the language from the recovery menu (if there is one).
- Go to Advanced β File Manager (on some firmware, the path may be different).
- Find the file /data/system/gesture.key (or password.key) and delete it.
- Reboot the phone.
What happens? Once you delete the gesture.key file, the system can't check the pattern lock, and the phone unlocks, but this method doesn't work on all models: on new File-Based Encryption devices, the file may be missing or protected.
Insert SD-map OTG-flash-drive|Download gesture.key file (if you need a replacement)|Check the battery charge (minimum 30%)|Make sure the model supports File Manager in Recovery-->
3. Hard Reset (full reset)
If the previous methods didn't work, the radical solution is a complete reset to factory settings (Hard Reset), which will remove all data from your phone, including photos, contacts and apps. Use it only as a last resort!
How to make Hard Reset on Xiaomi:
- Turn off the phone.
- Press Volume Up + Power before the Recovery menu appears.
- Select Wipe Data β Wipe All Data (navigation with volume buttons, confirmation β power button).
- Confirm the action (it may be necessary to enter a password from Mi Account if the phone is tied!).
- After reset, select Reboot β Reboot to System.
β οΈ
Note: On devices with MIUI 12+ and Mi Account tied, Hard Reset may require login and password from your account. If you donβt remember them, the phone will turn into a brick, which will be extremely difficult to unlock!
What to do if you need a Mi Account after Hard Reset?
4. Unlock through ADB (for advanced users)
If the phone is debugging on USB (USB Debugging, you can try resetting the pattern lock through ADB (Android Debug Bridge is suitable for users who have previously activated the developer mode.
Instructions:
- Connect your phone to your computer through USB-cable.
- Open the command line (Windows) or terminal (macOS/Linux) and type in: adb shell su rm /data/system/gesture.key reboot
- If the su command doesnβt work, then there are no root rights β try an alternative method: adb shell am start. -n com.android.settings/.ChooseLockGeneric adb shell input text 1234 adb shell input keyevent 66 (It mimics input. PIN-code 1234 β if it has been established earlier).
β οΈ
Note: ADB only works if USB debugging was enabled before locking. New Xiaomi firmware may require additional confirmation on the phone screen, which is not possible with a locked device.
5. Use of service codes (for older models)
Some older Xiaomi models (e.g. Redmi 3S, Redmi Note 4) can reset the pattern lock through service codes, which does not work on all devices and may depend on the firmware version.
Try the following combinations:
- π ##7780## - Resetting settings (user data is saved).
- π *2767*3855# β Resetting everything (including internal memory!).
- π ##3646633## - Entrance to the engineering menu (on some firmware allows you to reset the lock).
Warning: Service codes can lead to irreversible consequences, including loss of IMEI or damage to firmware.
π‘
If the service codes don't work, try dialing them in the Phone app, and some firmwares block the codes and instead send a message saying "This code is not supported."
6. Contact the Xiaomi Service Center
If none of these methods worked, you have to contact the official service center Xiaomi.
- π Check or warranty card (proof of purchase).
- π± Phone box (in some models, the serial number on the box must match the IMEI device).
- π Passport (for proof of identity).
The service center can unlock the phone through special software, but this will take from a few days to a week, the cost of the service varies from 500 to 2000 rubles depending on the model and the complexity of the lock.
β οΈ
Warning: Don't go to informal workshops promising "quick unlock" for a low price, and you're at risk of getting a phone with damaged firmware or stolen data (if the wizard copies your internal memory).
Comparison of Unlocking Methods
| Method | Conditions required | Loss of data | Difficulty | It works on new models. |
|---|---|---|---|---|
| Mi Account | Linked account, Internet | β No. | β | β Yes. |
| Recovery (delete gesture.key) | SD-Map, access to File Manager | β No. | ββ | β οΈ Partially. |
| Hard Reset | β | β Yes (full) | β | β Yes. |
| ADB | USB debugging enabled | β No. | βββ | β No (on new firmware) |
| Service centre | Phone IDs. | β No. | ββββ | β Yes. |
π‘
The most universal methods are unlocking through Mi Account and Hard Reset, the first one saves data, the second one is guaranteed to work, but it will delete everything from the phone.