The situation when you pick up your smartphone, swipe your finger across the screen, but the device declares that an incorrect pattern key has been entered is familiar to many users. Panic at this moment is natural: important contacts, work documents and personal photos are stored inside the gadget, the loss of which can become a serious problem. However, contrary to popular belief, locking the screen does not always mean the need to completely reset the settings to the factory state with the destruction of all information.

Modern operating systems Android provide several levels of protection and methods for restoring access. Depending on the firmware version, device model and account pre-setup, there are legitimate ways to bypass the protection. Next, we will look at the most effective methods that will help you regain control of your device while maintaining the integrity of the file system.

Before taking active steps, you need to understand the nature of the blocking. Picture key is just a software restriction of access to the interface, and not a physical breakdown. In most cases, the system stores the hash of your drawing in a special system file, deleting or overwriting which allows you to reset the protection. It is important to act consistently and not apply methods blindly, so as not to aggravate the situation.

Using the “Forgot the key” function through a Google account

The simplest and safest method, which was a standard solution for older versions Android (up to 5.0 Lollipop inclusive), but sometimes works on newer builds under certain conditions, is to use a linked Google account. If, after five unsuccessful attempts to enter a pattern, the message “Forgot your pattern?” appears on the screen, you are in luck. This means that the system is ready to verify your identity remotely.

Click on the button that appears. The device will ask you to enter the login and password for the account Googlethat was previously synchronized with this smartphone. It is extremely important that at this moment the gadget has an active connection to the Internet via Wi-Fi or a mobile network. After successful authorization, the system will prompt you to set a new blocking method or disable it completely.

⚠️ Attention: On modern versions of Android (9.0 Pie and higher), this button is often absent from the blocking interface for reasons of increased security. If you do not see the option to restore via Google, do not try to guess combinations endlessly - this may lead to temporary blocking of the device for several hours.

If the Internet is turned off, the system may offer to call a blocked number. During an incoming call, you may sometimes be able to minimize the lock screen and quickly go to Settings to turn on data. This trick is unstable and depends on the specific shell of the manufacturer, for example MIUI or OneUI, but it’s worth a try, since it does not require connecting to a PC.

💡

Make sure that you enter the exact Google account password that was used when initially setting up the phone. Changing the password in a browser on another device may take up to 24 hours to synchronize with a locked phone.

Deleting a key file via Recovery and ADB mode

For advanced users who had USB debuggingenabled on their smartphone, there is a powerful command line tool - Android Debug Bridge (ADB). This method allows you to directly interact with the device's file system, bypassing the lock screen. The essence of the method is to delete the system file gesture.key or password.keyin which the encrypted picture is stored.

To implement this method, you will need a computer with ADB drivers installed and a USB cable. Connect your locked smartphone to your PC. Open a command prompt or terminal on your computer and enter a command to test the connection. If the device is detected correctly, you will see its serial number in the list of connected devices.

adb devices

After confirming the connection, you need to obtain superuser rights (root) within the ADB session and delete the target file. Run the following commands in sequence. The first command requests root access, the second goes to the directory with the keys, the third deletes the file, and the fourth reboots the device.

adb shell

su

rm /data/system/gesture.key

reboot

What to do if the su command did not work?

If you receive an error or access denial when entering the su command, it means that root access have not been obtained on your device. In this case, this method will not work, and you will have to look for alternative options, since without superuser rights the system will not allow you to delete a protected file.

After a reboot, the lock screen may still require you to enter any pattern or password. Just enter any arbitrary combination - the system will accept it, since the verification file has been deleted. Immediately after entering the menu, it is recommended to go to the security settings and install a new, memorable key.

☑️ Preparing to work with ADB

Done: 0 / 4

Reset via Google's Find My Device service

Google provides an official tool for remote device management called Find My Device (Find Device). The service was originally created to find lost phones and lock them, but it also allows you to perform remote factory resets. Although a classic reset erases data, in some scenarios, using this tool is the only legal way to remove the lock if other methods have not worked.

Go to the service website from any other device (computer or tablet) under the same Google account that is linked to the locked phone. The system will try to determine the location of your gadget. If the phone is online, you will see three options for actions: “Ring”, “Block” and “Wipe device”.

Action Impact on data Requirements
Call Data are saved Phone must be turned on
Lock Data is saved Need a new temporary password
Clear device Full deletion Internet availability on the phone

Select the “Block” function. The service will prompt you to set a new temporary password that will replace the forgotten pattern. Enter the new code, confirm it and press the lock button. After a few minutes, a field for entering the new password that you just set will appear on the screen of the locked smartphone.

💡

The remote locking function via Find My Device works even if data transfer is disabled on the phone itself, provided that the command was sent before the connection was lost, but this method is only effective if the Internet is active at the time the command is received.

⚠️ Attention: Be extremely careful when choosing the option "Clean device." This command will initiate a Factory Reset, which will permanently delete all photos, contacts, and apps. Use this function only as a last resort when saving data is not possible.

Unlocking via Safe Mode

Sometimes the locking problem is not caused by a system failure, but by a third-party application that has intercepted administrator rights or installed its own lock screen on top of the system one. In such cases, entering Safe Mode allows you to temporarily disable all third-party software and access settings to remove malicious or conflicting applications.

To enter this mode, you usually need to hold down the power button on the locked screen until the shutdown menu appears. Then you need to press and hold with your finger the option “Shut down” or “Restart” on the touch screen. The system will ask for confirmation to enter safe mode. On some models Samsung or Xiaomi the combination of buttons may be different, for example, holding down the volume down button while booting.

After booting, you will see the words “Safe Mode” in the corner of the screen. All third-party icons will become translucent or disappear. Go to application settings and look for apps that have overlay rights or device administrator rights. Remove suspicious screen lockers.

  • 📱 Reboot your device as usual to exit safe mode.
  • 🔍 Check the list of applications with administrator rights in the security menu.
  • 🗑️ Remove recently installed apps that may have caused the lock.

If after deleting applications and rebooting, the pattern disappears, then the problem has been solved. However, if the blocking remains, it means that it is installed at the system level, and methods with third-party software are powerless here. In this case, you need to move on to deeper methods of interfering with the system.

📊 Which unlocking method did you try first?
Via Google account
Using ADB console
Through the Find My Device service
I immediately reset the settings

Specific methods for different manufacturers

Smartphone manufacturers often add their own shells on top of a clean one Android, which have unique recovery functions. For example, devices Samsung have a service Find My Mobile, which is an analogue of the solution from Google, but works much more efficiently on native devices. If you have created a Samsung account and enabled the remote unlock function, you can remove any type of lock through the service's web interface without losing data.

For owners Xiaomi with a linked Mi account, it is possible to unlock through the cloud synchronization service, although in the latest versions MIUI this function has become more strict. In some cases, calling the device helps: during a conversation, you can press the “Back” button or minimize the call, which sometimes opens access to the desktop or notification shade, from where you can get to the settings.

Smartphones LG in the past had a “Smart Unlock” function, which allowed you to unlock the device when you were in a certain place or when connected to a trusted Bluetooth device. If you have set up such a function, try going to a place that is defined as “Home”, or turn on the Bluetooth headset with which the phone was previously paired.

⚠️ Attention: Interfaces and capabilities of manufacturers' services are constantly updated. Features that worked on 2020-2022 models may be removed or changed in new firmware for 2026-2026 releases. Before attempting to unlock, check the current capabilities in the official help center of your device brand.

Prevention and creation of backup copies

The best way to combat loss of access is timely prevention. Regular creation backups data to cloud storage ensures that even if a Hard Reset is necessary, you will not lose important information. Set up automatic synchronization of contacts, photos and documents with Google Drive or other cloud services.

It is also recommended to write down your pattern and PIN codes in a safe place, such as a password manager or a paper notepad that is kept in a safe place. Do not rely only on memory, as the stressful situation when blocking often leads to the fact that even familiar combinations fly out of your head.

  • ☁️ Set up weekly automatic synchronization with the cloud.
  • 🔐 Use a password manager to store PIN codes.
  • 📝 Write down the unlock data in a physical notepad.

Remember that biometric security methods, such as a fingerprint or facial recognition, should only be an addition to the digital key, and not a complete replacement for it. The system will always require you to enter a pattern or password after rebooting the device, so knowing this code remains critical.

Why doesn't biometrics replace the password completely?

Biometric data is stored in a secure security module, but the disk encryption key is tied to your master password. After a reboot, this key cannot be restored without entering the code, so the pattern key remains the main means of protecting data.

Frequently asked questions

Can I unlock the phone if I have forgotten the password for my Google account?

You can restore access to your Google account through the recovery procedure on the website google.com from any other device. However, until you restore access to your account, unlocking methods through Google services will not be available. Try using a recovery phone number or a backup email.

Will resetting via Find My Device delete my photos?

If you use the Erase command, then yes, all data will be deleted. But if you use the “Lock” command and set a new temporary password, your data will remain in place, and the old pattern will be replaced with a new code.

Does the method work with the gesture.key file on Android 12 and higher?

On modern versions of Android, starting from 10 and higher, section /data/system is often encrypted, and accessing it via ADB without an unlocked screen is impossible even with root access, unless specific encryption was used. Therefore, this method is considered obsolete for new devices.

What to do if the phone says “Too many attempts to enter the pattern key”?

This is a security mechanism. You will have to wait the specified time (from 30 seconds to 24 hours) without turning off the phone. Attempting to guess the key during the timer may increase the lockout time. It is better to use this time to prepare your PC or restore access to your account.

Will removing the SIM card help you remove the lock?

No, removing the SIM card does not affect the screen lock pattern. The key is stored in the device memory and is not associated with the SIM card. However, if you do not have Wi-Fi, replacing the SIM card with another one with active Internet may be necessary for Google services to work.