[TUTORIAL] Crack Android Pattern Lock using ADB

Disclaimer : This is for educational purposes only. You shan’t use this on other people’s phones without permission under any circumstances. We are not responsible for any misuse of this hack.

If you’ve forgotten your device pattern and have no way of unlocking your device, do not fret. This tutorial allows you to bypass the pattern lock.


Cracking the Lock Pattern

Note : This has been tested on Gingerbread, Ice Cream Sandwich and Jelly Bean.

Connect the phone to your PC and open ADB on the terminal. We now need to confirm our device is connected. To do that, type:

adb devices


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';


adb shell rm /data/system/gesture.key

There’s a video showing how method 2 is done (thanks to melvin chng) :

Users can try both the methods together or individually. You can run the first method, reboot your device, run the second method and reboot your device again.


  • Every line is an individual command so hit ENTER after every line.
  • In the second method, type all of the command and press ENTER.
  • After running both methods and rebooting, you may still see a pattern. Just try any random pattern and it’ll unlock.
  • There is no guarantee that this’ll work for every device.

via: XDA Developers