How to Access a Locked Android Phone via Usb

Joel Mason

Android, Tutorials

If you have ever found yourself in a situation where you forgot the password or pattern to unlock your Android phone, don’t worry! In this tutorial, we will guide you on how to access a locked Android phone via USB.

With a few simple steps, you can regain access to your device and retrieve your important data. Let’s get started!

What You Will Need

Before we begin, make sure you have the following things ready:

  • A computer with the necessary USB drivers installed
  • A USB cable to connect your Android phone to the computer
  • ADB (Android Debug Bridge) installed on your computer

Step 1: Enable USB Debugging

Firstly, we need to enable USB debugging on your locked Android phone. Follow these steps:

  1. Turn on your phone and go to “Settings”.
  2. Scroll down and tap on “About Phone” or “About Device”.
  3. Find the “Build Number” option and tap on it seven times.

    This will enable Developer Options.

  4. Go back to the main settings menu and find “Developer Options”. It should be located above or below “About Phone”.
  5. Inside Developer Options, look for “USB Debugging” and enable it.

Step 2: Connect Your Phone to the Computer

Next, connect your locked Android phone to the computer using the USB cable. Make sure that both ends of the cable are securely plugged in.

Step 3: Launch ADB Shell

Now it’s time to open an ADB shell on your computer. Here’s how:

  1. Open the command prompt or terminal on your computer.
  2. Navigate to the directory where ADB is installed.

    If you haven’t installed it yet, download it from the Android Developer website and extract it to a convenient location.

  3. Type “adb devices” and press Enter to check if your phone is connected properly. If it shows your device’s serial number, you’re good to go.
  4. Enter the command “adb shell” to access the ADB shell on your phone.

Step 4: Reset Your Lock Screen Password/Pattern

Finally, we can reset the lock screen password or pattern on your Android phone. Depending on your phone’s manufacturer, there are different commands you can use. Here are a few examples:

  • Samsung: Type “su” and press Enter.

    Then enter “rm /data/system/gesture.key” and press Enter again.

  • LG: Type “su” and press Enter. Then enter “rm /data/system/locksettings.db” and press Enter again.
  • HTC: Type “su” and press Enter. Then enter “rm /data/system/password.


The above commands are just examples, and they may not work for every Android phone model or version of Android. It’s crucial to research specific instructions for your device before proceeding.

Step 5: Reboot Your Phone

After successfully executing the appropriate command for your device, you can safely reboot your Android phone by entering the command “reboot” in the ADB shell.


By following these steps, you should now have access to your locked Android phone via USB. Remember to set a new lock screen password or pattern to secure your device.

It’s important to note that this method might not work for all Android phones due to different security measures implemented by manufacturers. If you encounter any issues, it’s best to seek professional assistance or contact your phone’s manufacturer for support.

With a combination of USB debugging and ADB commands, you can regain access to your locked Android phone without losing any data. Always remember to take precautions and keep your device secure with a strong lock screen password or pattern.

Android - iPhone - Mac

 © 2023 UI-Transitions

Privacy Policy