https://rootmygalaxy.net/bypass-pattern-unlock-on-android-via-adb-commands/
USB Debugging must be Enable
Ensure that Unknown Sources is enabled previously on your Android device. Also, make sure you have the proper ADB software installed on your PC, alongside the drivers.
Connect your Android device to your computer, and launch ADB in the CMD window.
Next, issue the following commands :
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 your Android device, and your pattern unlock should still be there, but you can unlock your device with any pattern you like, so you can disable it or set a new one later on.
If the above command doesn’t work for you, issue the following command instead :
adb shell rm /data/system/gesture.key
Even in this case, after rebooting, whichever pattern you decide to put in will be registered, and you can either disable or set a new one.