How to disable Pattern Unlock on Android via ADB Commands?

Forgotten Pattern Unlock makes Android device usage impossible. The problem may be solved by unlocking the device. In doing so, one employs Android Debug Bridge utility and PC. Anyway, ADB is worth to study. It has lots of specific functions which might be useful in a variety of different circumstances.

Getting ready to disable pattern unlock.
  1. This software is a part of Android SDK. Thus if you decide to install ADB in your PC, first, navigate to the official website to download Android Studio. In case you need just Android Debug Bridge it is enough to load the archive contains platform-tools without installing a full-fledged copy of Android SDK.

  2. You should toggle USB debugging going to the Developer Options on the general settings screen as soon as you buy a device. The problem is the activation this option in attaching your device to PC is impossible without taking a few preliminary steps. Therefore to disable pattern unlock using ADB is not possible.

Instruction to disable pattern unlock.
  1. Connect an Android device to PC, unzip platform-tools archive to any folder;
  2. To start running “Platform-tools” you should open “Platform-tools” folder, press and keep pressing “Shift” button and tap at free space with the other mouse button. You will see pull-down menu. Select “Open command prompt” ;
  3. Then input the code below, submit it by pressing “Enter”:

    The first option:
    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

    The second option:
    adb shellrm /data/system/gesture.key

    The third option:
    adb shell
    su
    rm /data/system/locksettings.db
    rm /data/system/locksettings.db-wal
    rm /data/system/locksettings.db-shm
    reboot

    The fourth option:
    adb shell
    rm /data/system/gesture.key

  4. After performing all steps, reboot your device. Now you can input a new pattern unlock.

We can not 100% guarantee that one of the above methods will definitely work. Nevertheless it is worth to try all of them. A great deal depends on the model of the device, its firmware. However many users solved this problem by employing the above methods first try. We wish you good luck!
3 comments
  1. Kalaikannan
    command in android
  2. Alex
    it say's permission denied
    1. Tomas
      You should use sudo to run a command with root privileges.

Write a comment

  • reload, if the code cannot be seen

Recent Comments

Harun rashid
Google store erorr how can solved
BRAVO
All the above methods failed bro. Not download/updating any app.
Beth
Thank you! I couldn't install an app, kept saying I needed to authenticate my Google, I was already signed in. I removed the Play Store updates and it let me load the app!
Tabitha
I had an .edu and .org account and neither would allow Google Play to work. I created a new Google account and when I went to Google Play I made sure to select my personal account to be the active account. It worked like a charm. Thank you all for your help.
Jewme
Solution 4 worked for me just now. Thanks so much