The forgotten graphical password on Xiaomiβs smartphone is a situation that one in five users face. The main problem is that most standard unlock methods (for example, through Mi Account) require a factory reset, which leads to complete loss of data β photos, contacts and messages.
In this article, we will discuss 4 working methods for unlocking Xiaomi, Redmi and POCO with saving data β from using ADB to bypassing Fastboot mode. Importantly, the effectiveness of methods depends on the version of MIUI, the device model and the availability of debugging over USB. If you have never connected your phone to your computer before, the chances of success are reduced β but not zero.
Before you start, check:
- π Do you have access to a computer with Xiaomi drivers installed?
- π± Is the phone debugging enabled? USB (Even if you donβt remember, try all the methods in order).
- π Is the phone connected to Mi Account (Xiaomi account)?
1. Unlock via ADB (if USB debugging was enabled)
It only works if you've previously activated USB debugging in the developer's settings, and it's the most reliable way to save data, but it requires preparation.
What you need:
- π» Computer with Windows or macOS.
- π USB-Type-C Cable (original, undamaged).
- π₯ Utility. ADB (Android Debug Bridge. Download it from the official website.
Step-by-step:
- Connect your phone to your computer. The USB Debugging Notice will appear on the lock screen, confirm it (if the phone allows).
- Open the command prompt (Windows) or Terminal (macOS) in the folder with ADB.
- Enter the command to check the connection: adb devices If the device is displayed, proceed to the next step.
- Delete the file with the pattern lock: adb shell rm /data/system/gesture.key or for newer versions of MIUI: adb shell rm /data/system/locksettings.db adb shell rm /data/system/locksettings.db-wal adb shell rm /data/system/locksettings.db-shm
- Reboot your phone: adb reboot
After the reboot, the graphical password will be reset and the data will remain intact. If the command does not work, try an alternative:
adb shell am start -n com.android.settings/.ChooseLockGeneric
adb shell input text 1234
adb shell input keyevent 66It mimics input. PIN-1234 (if previously reserved) PIN).
Download ADB and unpack it into a separate folder |
Connect your phone to your computer with the original cable|
Check the display of the device by the command `adb devices`|
Delete gesture.key or locksettings.db| files
Reboot the phone after completing commands-->
π‘
If the team `adb devices` Does not show your Xiaomi, install Mi drivers PC Suite or manually update the driver through Device Manager (Windows).
2. use of Mi Account (if the phone is linked to the account)
If your Xiaomi is tied to Mi Account and you remember the username and password, this method will work 90% of the time, but on some models (for example, Redmi Note 10 Pro or POCO X3 Pro) after unlocking, you may need to reset your settings.
Instructions:
- On the lock screen, tap Forgot Password? (or Forgot Password?).
- Select Sign in via Mi Account.
- Enter your email/phone and password from your Xiaomi account.
- Confirm unlocking via SMS or email (if two-factor authentication is enabled).
β οΈ Warning: If the system offers a reset after you log in, cancel the operation and try other methods (MIUI 12.5+) This method leads to loss of data.
| Xiaomi model | Supports unlocking through Mi Account without resetting? | Is the Internet necessary? |
|---|---|---|
| Redmi Note 8/9/10 | Yes (on MIUI 11-12) | Yes. |
| POCO F3/X3 | Partially (possible reset) | Yes. |
| Mi 11/12 Series | No (reset required) | Yes. |
| Redmi 7A/8A | Yes (on all versions of MIUI) | No. |
3. Unlock via Fastboot mode (for advanced users)
This method is suitable if USB debugging is disabled, but you have access to Fastboot mode.It requires the installation of a custom recavator (such as TWRP), which can lead to a loss of warranty.
β οΈ Note: Fastboot missteps can permanently block the bootloader. Use this method only if you are confident in your skills.
Step-by-step:
- Turn off the phone. Press the Power button + Volume down to enter the Fastboot.
- Connect your phone to your computer and check the connection: fastboot devices
- Unlock the bootloader (if it is blocked): fastboot oem unlock This will delete all data! If the goal is to save files, skip this step and move on to the next one.
- Install TWRP (if bootloader unlocked): fastboot flash recovery twrp.img fastboot boot twrp.img
- In TWRP, go to Advanced β File Manager and delete files: /data/system/gesture.key /data/system/locksettings.db
- Reboot the phone.
If the bootloader is locked and unlocking through the Mi Unlock Tool requires a wait (usually 7-30 days), this method is not suitable for urgent unlock.
What if the fastboot canβt see the device?
4. Bypassing locks via Safe Mode (for MIUI 12 and later)
On some firmware (MIUI 12+), you can temporarily disable the pattern lock by booting into Safe Mode, which works if the lock is installed through third-party software (for example, AppLock).
Instructions:
- On the lock screen, hold the Power button until the off menu appears.
- Press and hold Turn Off (or Reboot to Safe Mode, if any).
- Confirm the download in Safe Mode.
- After downloading, uninstall the application that installed the pattern lock (such as Smart Lock or AppLock).
- Restart your phone in normal mode.
If the lock is set at the system level (Native MIUI pattern lock), this method will not work.
5. Alternative methods: what to do if nothing helps
If all of these methods fail, extreme measures remain:
- π Reset via Mi Cloud: If your phone is connected to Mi Account, you can remotely reset your settings via i.mi.com.
- π οΈ Contact the service center: Official centers Xiaomi can unlock the phone on the documents (passport) + Cost: 1000 to 3000 rubles.
- π Operational vulnerabilities: On some models (Redmi) 5/6/Note 5) Vulnerabilities are being exploited EMMC or EDL-mode, but they require special equipment (UFi Box, EasyJTAG).
β οΈ Note: Use of unofficial services to unlock through EDL It may lead to a blockage. IMEI Check the workshop reviews before contacting.
6. How to avoid future data loss
To avoid the problem of forgotten passwords again, follow these guidelines:
- π Set up a backup. PIN-code in lock settings (Settings) β Password and security β Screen locking).
- βοΈ Enable automatic backup in Mi Cloud (Settings) β Mi Account β Mi Cloud β Backup).
- π± Activate Smart Lock (unlocking by trusted devices/places) in Settings β Password and security β Smart Lock.
- π₯οΈ Connect your phone to your computer regularly and check your work. ADB (at least once in 3 months).
If you often forget passwords, use password managers (like Bitwarden or KeePassDX) to store backups. PIN-code.
π‘
Even if you successfully unlocked Xiaomi without losing data, set up your backup PIN and cloud backup immediately.