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 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:
      Android-pattern-lock-number-chart
      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-pattern-lock-via-ADB-on-Android

    • 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!

  • 776 Posts
  • 0 Comments
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: prajith@theandroidsoul.com