I am using Lineageos 17.1 on the FP3 (the phone is not rooted).

I do know my screen pattern code (it is a 6x6 pattern), but I am not able to enter it correctly, because I disabled that the pattern is shown and that the sequence is visible.

In the recovery mode I can enable adb and I tried to delete the file

adb shell rm /data/system/gesture.key

which worked in the past, but now this file does not exist anymore on Lineageos 17.1. ADB unfortunately does not work when the screen is locked.

Is there another way to bypass the screen pattern? Doing a factory reset is the last option I want to do. Making the pattern visible should be enough in principle.

  • bad idea anyway because deleting locksettings will destroy encryption (on encrypted devices)
    – alecxs
    Feb 17, 2021 at 20:11
  • the bootloader is locked, so I guess I have no chance?
    – cerv21
    Feb 17, 2021 at 21:06
  • 1
    I managed to enter the pattern correctly after almost 70 attempts. There it is written enable adb (I think it is a custom recovery from Lineageos), but I do not think it gives me root access. Does that make sense?
    – cerv21
    Feb 17, 2021 at 21:27

1 Answer 1


I've had success removing a lock screen with the following sequence of commands:

adb shell settings put secure lockscreen.disabled 1
adb shell mv /data/system/locksettings.db /data/system/locksettings.db.old
adb reboot

Following the device restarting, the lock screen should be gone, with the device booting directly to the home screen.

  • 1
    Note settings put secure does not work in recovery mode
    – alecxs
    Apr 17, 2022 at 8:05
  • 1
    In the question it is mentioned that adb does not work and that the device is not rooted (which should be required for your second command).
    – Robert
    Apr 21, 2022 at 12:04
  • @Alsch is it working on android 10?
    – PaLa
    Jan 14, 2023 at 23:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .