How to remove the lock from the Xiaomi phone if you forgot the password

When a smartphone owner suddenly finds he can’t access his device, it happens more often than it seems. A forgotten pattern lock or a mis-entered digital code can turn a modern Xiaomi into a useless piece of plastic and glass. Panic at such moments is a bad adviser, as rush often leads to irreversible errors, such as repeated incorrect input attempts, which only increases the lock time.

Fortunately, the MIUI ecosystem offers several proven solutions, from standard recovery procedures to more radical reset methods. In this article, we will take a closer look at each of the available methods, assess their risks, and help you regain access to your data or at least to the functionality of the device.

Before you start taking action, you need to be clear about what type of protection you are facing, whether it's locking the screen, protecting your Mi Account, or even locking the bootloader, and it's a big deal about your strategy, so you shouldn't try the "pump" method that can make things worse.

Determination of the type of blocking and primary diagnosis

The first step is always to diagnose the problem accurately, because the methods of solving different types of protection are radically different. If the screen just asks you to enter a pin code or draw a figure, this is one scenario, but if after a reboot the phone requires a password from a Mi Account that you do not remember, the task becomes more difficult.

Notice the messages on the screen: if the device says "Too many attempts to enter the pattern lock", then the security timer has gone off, in which case you just have to wait for the specified time, usually from 30 seconds to several hours, before trying again, and trying to guess the code during this period will only reset the timer and increase the waiting time.

⚠️ Note: If you have a requirement to enter a Google or Mi Account after resetting, and you do not remember the data, the device may become unusable without the intervention of a service center.

It is also worth checking whether the smartphone is connected to the Internet, as some recovery methods require an active connection. Without access to Wi-Fi or mobile data, remote unlocking through cloud services will not be possible, and you will have to resort to local reset methods.

πŸ“Š What type of blockage do you have?
Forgot the pattern lock
Forgot. PIN-code
Blocking of Mi Account
Phone says "Device locked"
Other

Use the "Forgot Password" function through Mi Account

The most civilized and secure way to restore access involves having a Xiaomi account tied up. If the locked device has been enabled Internet and sync, you can use the cloud service for remote management, you need to go to the official website of the cloud service from a computer or another phone.

Once logged in, you should find the device search section in your profile, often marked with a radar icon or called "Device Search." From the control menu, select the screen unlock option that will force you to remove the current security method (pattern lock or password) and allow you to set a new one.

  • πŸ”‘ Go to the official Mi Cloud service website from any available device.
  • πŸ“± Sign in under the same login used on the locked smartphone.
  • πŸ“ Select your device from the list of available gadgets in the control menu.
  • πŸ—‘οΈ Click the "Unlock" button and confirm the action to reset the screen password.

This only works if Find Device has been activated in advance in the security settings, but if it has been disabled or the phone has no access to the network, this method will not help, and more radical options will have to be considered.

πŸ’‘

Regularly check the status of the Mi Account binding in the security settings, so that at a critical moment you do not find yourself alone with a locked screen.

Resetting with Recovery Mode (Hard Reset)

If cloud-based methods are not available, the only option is a factory-based reset, known as Hard Reset, which completely removes all user data, including photos, contacts and apps, returning the phone to the β€œout of the box” state, via a dedicated recovery menu that downloads independently of the operating system.

To enter recovery mode, you need to turn off your smartphone completely, then press a certain combination of buttons. On most Xiaomi and Redmi models, this is the simultaneous pressing of the volume button and the power button. Hold them until the brand logo appears, after which you can release the power button, continuing to keep the volume.

The key combination for entering Recovery:


Volume Up + Nutrition (hold until vibration/logo)

Once you enter the Recovery Mode menu, the navigation is done with volume buttons (up/down), and the choice is confirmed by the power button. You need to find the Wipe Data item and select the Wipe All Data option. The system will ask you to confirm the action, often requiring you to select Confirm or enter the word "yes" on the virtual keyboard if it appears.

⚠️ Warning: The reset process is irreversible. All files not stored in the cloud or on a memory card will be permanently lost.

β˜‘οΈ Preparation for Hard Reset

Done: 0 / 4

Once the cleaning process is complete, which can take a few minutes, the phone will automatically restart.The first boot after the reset usually takes longer than usual, as the system re-initializes all components and creates a new file structure.

Unlocking via computer and ADB (for advanced)

For users who have previously included USB debugging in the developer menu, there is a possibility of unlocking via a computer.This method requires the device driver and Android Debug Bridge (ADB) platform installed on a PC. It allows you to send commands directly to the system without passing the lock screen, but only works if the device has already been authorized on that computer.

The essence of the method is to connect the phone to the PC through USB-If the connection is successful and debugging is allowed, you can delete files that store information about the access keys or reset security settings by software.

ADB Team TeamDescription of actionRisk of error
adb devicesChecking the device connectionLow.
adb shell rm /data/system/gesture.keyDeletion of the pattern lock fileMedium.
adb shell rm /data/system/password.keyDeletion of the file PIN-codeMedium.
adb rebootRebooting the deviceLow.

It’s worth noting that on modern versions of Android and MIUI shells, this method rarely works because of enhanced security measures: Key files are often encrypted or tied to hardware identifiers, making it useless to simply delete them.

Why can’t the ADB work on new models?
On modern devices, the /data/system partition is often protected by additional layers of encryption, and without root rights or an unlocked bootloader, key removal commands simply won’t be executed by the system even if debugging is enabled.

Unlocking the Mi Account after resetting

Once you run Hard Reset, you may encounter an activation screen where the system will require you to enter a password from a previously used Mi Account, a Find Device theft protection feature that prevents unauthorized users from using the phone after a reset, and if you forget this password, you won't be able to unlock the phone in the standard way.

The only legal way to do this is to re-access your account through a password reset procedure on the official website, so you need to access your linked phone number or email, and if that data is also lost, the recovery process can take a long time and require you to contact support with a check for your purchase.

It is important to understand that there are various informal services and programs that offer to β€œremove” an account, but their use carries high risks, such actions can disrupt the system, lead to instability or, in the worst case, turn the device into a β€œbrick” with a blocked bootloader.

⚠️ Note: Using third-party programs to bypass Mi Account may be regarded by the manufacturer as an attempt to hack, which will void the warranty on the device.

Prevention of blocking and data retention

To avoid such stressful situations in the future, it is recommended to set up a backup of important data in advance. Xiaomi provides convenient tools for automatically synchronizing contacts, SMS, notes and photos with cloud storage or computer.

It’s also worth writing your passwords and graphics keys to a secure location, such as a paper notebook or a dedicated password manager that doesn’t depend on locking your phone. Regularly updating your backups ensures that even if you lose your device completely, you don’t lose important information.

  • πŸ“… Set up automatic data synchronization once a week.
  • πŸ’Ύ Repair photos and videos to an external hard drive.
  • πŸ“ Write your account details in a notebook and store it in a safe place.

Remember that the security of your device depends primarily on your foresight: Simple precautions take a few minutes, but can save you hours of nerves and finding solutions at a critical moment.

πŸ’‘

Regular backup and password writing is the only guarantee that locking your phone won’t be a disaster for your data.

Frequently Asked Questions (FAQ)

Can I unlock Xiaomi without losing data?
Without data loss, you can only unlock your phone through the Mi Cloud service (if you have enabled the device search function) or if you remember the password. In all other cases, including Hard Reset, the data will be deleted.
What to do if your phone asks for a Google account after a reset?
This is FRP (Factory Reset Protection) protection, and you need to enter the login and password of the Google account that was synced to the phone before the reset, and without that data, it's officially impossible to unlock the device.
How long does the Hard Reset process take?
The reset process itself usually takes 5 to 15 minutes, depending on the storage capacity and device model, and the first load after the reset can last up to 10 minutes.
Will a phone call help to remove the lock?
On very old versions of Android, there was a method of logging in via the call menu, but on modern Xiaomi with current versions of MIUI, this method does not work due to system security limitations.