How to unlock the pattern lock on Xiaomi Mi5: from Mi Account to Fastboot

Why Mi5 is blocked and what to do

pattern lock on Xiaomi Mi5 β€” convenient PIN-According to statistics from service centers, one in five Xiaomi owners have at least once encountered a locked screen due to a forgotten pattern. Mi5 β€” model of 2016 release, which did not yet have the function of Smart Lock (automatic unlocking on trusted devices).

In this article, we'll look at 5 working ways to remove a pattern lock, from official methods through Mi Account to technical solutions using ADB and Fastboot. Importantly, not all methods will save your data. If you sync your phone with Mi Cloud, the chances of recovering information without loss are much higher.

Method 1: Unlocking with Mi Account (official method)

The safest and most recommended way for Xiaomi is to use a tied 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
  • πŸ”„ The device is enabled synchronization with the cloud

Instructions:

  1. On the lock screen, click Forgot your password? (bottom of the screen).
  2. Select Sign in via Mi Account and enter the details.
  3. Confirm unlocking via SMS or email (if two-factor authentication is enabled).
  4. Create a new pattern lock or PIN-code.

⚠️ Note: If you have previously disabled Mi Cloud services or changed your account password, this method will not work.

πŸ“Š Have you ever forgotten a pattern lock?
Yes, Xiaomi.
Yeah, on another smartphone.
No, I always remember.
I do not use a pattern lock.

Method 2: Recovery Mode (Data Loss)

If Mi Account is not tied or you don't remember the login details, you'll have a hard reset via Recovery Mode, which will remove all the data from your phone, including photos, contacts and apps. Use it only as a last resort!

How to Sign In to Recovery on Xiaomi Mi5:

  1. Turn off the phone with a long press of the power button.
  2. Press Volume Up + Power at the same time and hold for 10-15 seconds.
  3. When the Mi logo appears, release the buttons.
  4. In the Recovery menu, select Wipe Data β†’ Wipe All Data (control – volume buttons, confirmation – power button).
Action.The resultImplementation time
Entrance to RecoveryMenu with the Mi logo10-20 seconds
Choice of Wipe DataDeletion of all user data2-5 minutes
Reboot (Reboot)The phone is starting as new.1-3 minutes

⚠️ Attention: On some firmware Mi5 After the reset, you may need to enter the data of the Mi Account that was previously linked (FRP-If you don't remember your account, your phone will turn into a brick».

β˜‘οΈ Preparing for resetting through Recovery

Done: 0 / 4

Method 3: Unlocking through ADB (for power users)

If it's Xiaomi. Mi5 debugging is included USB (USB Debugging, you can delete the pattern lock through ADB It requires a computer and basic command line skills.

Step-by-step:

  1. Connect your phone to your PC through USB-cable.
  2. Open the Command Prompt (Windows) or Terminal (macOS/Linux) in the folder with ADB.
  3. Enter the commands in order adb shell su rm /data/system/gesture.key reboot
  4. After rebooting, the pattern lock will be reset.

If the su command doesn't work, then there's no root permission on the phone, and then try an alternative method:

adb shell


cd /data/data/com.android.providers.settings/databases




sqlite3 settings.db




update system set value=0 where name='lock_pattern_autolock';




update system set value=0 where name='lockscreen.lockedoutpermanently';




.quit




reboot

What if the ADB can’t see the device?
Make sure you have Xiaomi drivers installed (download from the official website). USB-Turn on File Transfer on your phone. If it doesn't work, check if debugging is on. USB developer-setting.

Method 4: Using Fastboot and firmware (advanced level)

If previous methods have not worked, the phone remains firmware via Fastboot, which is suitable for the Mi5 with an unlocked bootloader. If the bootloader is locked, you will first need to unlock it through the official Mi Unlock Tool (the process takes up to 720 hours of waiting!).

Instructions:

  • πŸ–₯️ Download the official firmware for Xiaomi Mi5 (Fastboot version).
  • πŸ“‚ Unpack the archive in a folder with Fastboot (for example, C:\MiFlash).
  • πŸ”Œ Connect your phone in Fastboot mode (clip Volume Down) + Nutrition).
  • πŸ“ Launch MiFlash, select the firmware folder and click Flash.

After the firmware, the phone will be completely cleaned, including FRP-This method is guaranteed to work, but it takes time and technical knowledge.

πŸ’‘

Before you run the firmware, check the bootloader version (fastboot getvar anti). If the value is anti: 3 or 4, the bootloader is locked and you need to unlock it first.

Method 5: Contact Xiaomi Service Center

If all independent attempts to unlock failed, you can contact an authorized service center Xiaomi.

  • πŸ”§ Unlocking the lock (even with the FRP)
  • πŸ›‘οΈ Preservation of warranty (if the phone is guaranteed)
  • πŸ“± Data recovery (in some cases)

The cost of the service in 2026 ranges from 1,500 to 3,000 rubles, depending on the region and the complexity of the case.

  • πŸ“„ Bring a check or a box from your phone (to confirm ownership).
  • πŸ” If you remember, write down Mi Account data – this will speed up the process.
  • πŸ“± Charge your phone at least 30% (the service can check the performance).

⚠️ Note: Some β€œunofficial” services offer unlocking via exploits (e.g., unblocking, EDL-This can lead to loss of IMEI Or "bricking" your phone. Only contact trusted centers with a Xiaomi license.

πŸ’‘

A service center is the only legal way to unlock if the phone is warranty or you are unsure of your technical skills.

How to avoid blocking in the future

To avoid the problem of a forgotten pattern lock, follow these tips:

  • πŸ” Use Smart Lock (set up trusted devices, seats, or voice unlock).
  • πŸ“± Enable sync with Mi Cloud (contacts, photos, notes will be saved even after resetting).
  • πŸ“ Write down a pattern lock or PIN-code to a secure location (e.g., Google Keep with encryption).
  • πŸ”§ Make backups regularly through Settings β†’ Additionally. β†’ Backup.

We also recommend you disable Auto Lock in your lock screen settings if you often forget passwords. Go to Settings β†’ Lock screen β†’ Autolock and select Never or After 5 minutes.

FAQ: Frequent questions about unlocking Xiaomi Mi5

Can I unlock the Mi5 without losing data?
Yes, but only if USB debugging (ADB) is enabled or the phone is tied to Mi Account with active synchronization, otherwise the data will be deleted.
What to do if you ask for an old Mi Account after a reset?
It's FRP-You need to enter the account that was linked to the phone before the reset. If you don't remember, contact the service center.
How long does it take to unlock the bootloader?
Officially unlocking through the Mi Unlock Tool can take up to 720 hours (30 days) of waiting time, and the unlocking process itself takes 5-10 minutes.
Can I unlock Mi5 through my Google Account?
No, the Xiaomi Mi5 doesn't support unlocking through Google Account (unlike phones on pure Android).
Will the ADB unlock work on MIUI 14?
Yes, the ADB method works on all versions of MIUI, but requires USB debugging enabled. Newer firmware (MIUI 12+) may need additional confirmation on the phone.