Tips

How to change or remove lock screen pattern, PIN or password via ADB on Android 8.0 Oreo

Well, it looks like Android 8.0 Oreo has lots of new tricks up its sleeve than what meets the eye. We recently learned that Android Oreo supports theming…

Well, it looks like Android 8.0 Oreo has lots of new tricks up its sleeve than what meets the eye. We recently learned that Android Oreo supports theming…

8 Comments
Prajith

Prajith Travel and adventure junkie. Which is why he's now one of those cliche guys with a camera around his neck at all times. When doing neither, you'll find him uber lazy and glued to Netflix. Email: [email protected]

Well, it looks like Android 8.0 Oreo has lots of new tricks up its sleeve than what meets the eye. We recently learned that Android Oreo supports theming without root and now it has come to our attention that it also allows users to change the lock screen pattern, PIN or password, thanks to the new debugging commands.

In this post, we will walk you through the process of changing or removing your device’s lock screen pattern, PIN, or password via ADB. Follow the instructions provided below carefully.

Note: Be very careful when trying to change lock screen password via ADB. If you mess up, you risk losing all data on your phone. You’ve been warned!

How to change lock screen Pattern, PIN or Password via ADB

  1. Setup ADB and Fastboot on your Windows PC.
  2. Enable USB debugging from Developer options. For help, check this link.
  3. Connect your Android device to PC using a USB cable.
  4. Now open a command prompt window on your PC, and issue the following command:
    adb shell

    └ You might get a prompt on your device to “Allow USB Debugging”, select Yes/Ok/Allow.

  5. Once into ADB shell mode, issue the following commands to change your lock screen pattern, PIN or password:
    • Change lock screen pattern: To change pattern lock via ADB you first need to understand how Android numbers each dot on a pattern lock screen. It goes like like this: Top-left is number 1, middle dot is 5 and the last dot is number 9. Check the image below to better understand pattern lock numbering system on Android:

      Once you’ve understood the numbering pattern, issue the following ADB command to change your pattern lock:
      locksettings set-pattern --old xxxx xxxx
      
      Example: locksettings set-pattern --old 1456 6987

      └ Here 1456 is the old (read: current) pattern lock and 6987 is the new pattern lock. Check image below:

    • Change lock screen PIN: To change the lock screen PIN, you need to issue the following command:
      locksettings set-pin --old xxxx xxxx
      Example: locksettings set-pin --old 0000 8888

      └ Here 0000 is the old/current PIN and 8888 is the new PIN.

    • Change lock screen password: To change the lock screen password, issue the following command:
      locksettings set-password --old xxxx xxxx
      Example: locksettings set-password --old currentpassword newpassword

      └ Here currentpassword is the old/current PIN and newpassword is the new Password you wish to set.

  6. That’s it. If the above commands did not give you any error, you’ve successfully changed your lock screen Pattern, PIN or Password.

How to remove lock screen Pattern, PIN or Password via ADB

  1. Setup ADB and Fastboot on your Windows PC.
  2. Enable USB debugging on your Android device.
  3. Connect your Android device to PC using a USB cable.
  4. Now open a command prompt window on your PC, and issue the following command:
    adb shell

    └ You might get a prompt on your device to “Allow USB Debugging”, select Yes/Ok/Allow.

  5. Once into ADB shell mode, issue the following commands to remove your current lock screen Pattern, PIN or Password:
    locksettings clear --old xxxx

    Example: locksettings clear –old 4789
    └ If you’ve a pattern lock, check out the pattern lock numbering system in this image.

  6. That’s all. Your lock screen Pattern, PIN or Password should be disabled now.

Hope you find the tips shared on this page helpful. If you run into any issues, do let us know in the comments section below, we’ll try our level best to assist you.

Thanks to XDA Developers for finding this out!

8 responses to “How to change or remove lock screen pattern, PIN or password via ADB on Android 8.0 Oreo”

  1. rcstar6693 Avatar
    rcstar6693

    This is really cool!!

  2. Mishaal Rahman Avatar
    Mishaal Rahman

    Disappointed that you guys saw our post on XDA-Developers that was made 3 days before this, and made a tutorial out of it without crediting us =/

    1. Shivam Avatar

      Failing to give credit on this post was an honest error, and it has been fixed now. Thanks for bringing this to our notice.

      1. Mishaal Rahman Avatar
        Mishaal Rahman

        Thank you!

  3. afzal Avatar

    for using these we should unlock the device to change the settings to debug. is there another ways to change the settings!?

  4. Alos Avatar

    Is this supported on Android 9?

  5. confused Avatar
    confused

    What would the use case for this even be? If you need to enable debug, you have to know the password to begin with. This is like changing a password with WAY more steps.

  6. Nsamba Avatar

    It’s real cool I have learnt big about ADB