Home > Tips and Tricks

Unlock any Android Device via ADB [PIN/Password/Pattern]

In this guide, we will show you two methods to unlock your Android device via ADB. Recently one of our readers bought up an intriguing query (well, at least for me, it must have been quite an unfortunate event for him!). His device fell off and the screen was all shattered. While the pixels were still up and running, the display was totally hanged and wouldn’t respond to any interaction. He had a chat with the service center employees, and they said that it would take 3-4 days for the screen replacement. While the time frame wasn’t an issue, it was the data that was a major concern.

The last backup to Google Drive was a couple of days old and his Downloads folder with some important files wasn’t even part of this backup. Hence a backup was an absolute necessity. Moroever, even the service center guys would anyway reset the device, so a backup should have to be taken anyway before sending the device. But the screen isn’t even responding, so how could one take a backup? Well, this is where I did a little exploration and found out two nifty methods through which you unlock your Android device via ADB [PIN/Pattern/Password unlock].

unlock android device via adb

Not only that, but you will also be able to carry out all the desired tasks on your device. Be it for taking a backup, installing apps, sending messages, or calling someone, each of these activities will be just a click away, irrespective of the device you won or its Android version. However, there is one major requirement that you must have check-marked “beforehand”- USB Debugging should be enabled on your device. If that’s well and good, then let’s get started.

How to Unlock any Android Device via ADB [PIN/Pattern/Password]

We have listed two different methods below. The first one will give you complete control over your device, and you will be able to carry out all the desired tasks that we had listed above. On the other hand, the second method is a basic approach that would only help you to unlock your device. Moreover, the first method works on all types of lock-screen (PIN/Password/Pattern), whereas the second method doesn’t work on the pattern lock. So check out both these methods and then decide which to try out based on your requirements.

METHOD 1: Via ADB Tool

unlock android device via adb

  1. To begin with, connect your device to the PC via USB cable.
  2. Then download Android SDK Platform Tool and extract it anywhere on your PC.
    install adb platform tools windows
  3. Next up, download the Scrcpy ADB Tool from Github [direct link] and extract it inside the platform-tools folder.
  4. If it asks for the files to be replaced, then skip it (select Skip these files).
    unlock android device via adb
  5. Now head over to this folder’s address bar, type in CMD, and hit Enter. This will launch Command Prompt.
    unlock android device via adb
  6. Execute the below command to verify the ADB connection:
    adb devices

    unlock android device via adb

  7. If you get the Device ID, then the connection stands established and you could proceed ahead.
  8. So execute the below command for the tool to start:
    scrcpy

    unlock android device via adb

  9. It will now bring up your device but the screen will be black. So double-click or right-click on it to invoke the display.
    unlock android device via adb
  10. The screen will light up and you may now unlock your device by entering the desired PIN or Pattern.
    unlock android device via adb
  11. Once unlocked, you may now use your device and carry out the rest of the task. Pretty impressive, isn’t it?

METHOD 2: Via ADB Commands

  1. To begin with, connect your device to the PC via USB cable.
  2. Then download Android SDK Platform Tool and extract it anywhere on your PC.
    install adb platform tools windows
  3. Now head over to this folder’s address bar, type in CMD, and hit Enter. This will launch Command Prompt.
    command-prompt-inside-adb
  4. Execute the below command to verify the ADB connection:
    adb devices

    unlock android device via adb

  5. If you get the Device ID, then the connection stands established and you could proceed ahead.
  6. Now execute the below command to open the shell environment. It should list out your device codename/actual name.
    adb shell

    unlock android device via adb

  7. Next up, execute the below command to wake up the device’s display:
    input keyevent 26

    unlock android device via adb

  8. After that, execute the below command to unlock your device, replace XXXX with the PIN/Password:
    input text XXXX

    unlock android device via adb

  9. If you also had to tap on OK after entering the PIN/Password, then execute the below command:
    input keyevent 66

    unlock android device via adb

That’s it. These were the two different methods to unlock your Android device via ADB [PIN/Pattern/Password]. If you have any queries concerning the aforementioned steps, do let us know in the comments. We will get back to you with a solution at the earliest.


Share:
  • The second method worked for me and saved my client, thank you for this tutorial.

  • what if usb debugging is not enabled?

  • Does this solution keep the data on the phone

    • Sadique Hassan

      There will be no data loss with either of the two methods.