Skip to content

Instantly share code, notes, and snippets.

@virtualprodigy
Last active February 8, 2019 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save virtualprodigy/874c4fc0b2f6060a973a5c31a962d5d4 to your computer and use it in GitHub Desktop.
Save virtualprodigy/874c4fc0b2f6060a973a5c31a962d5d4 to your computer and use it in GitHub Desktop.
This gist is targeted at Android developers who need to unlock their device via terminal. Make sure you give your script access. Mac users run : $chmod +x <location of the script>. Windows users: The ADB shell commands below will work but if you may need to DL something to run shell scripts.
adb shell input keyevent KEYCODE_WAKEUP # activate
adb shell input touchscreen swipe 530 1420 530 1120 # swipe up
adb shell input touchscreen swipe 530 1420 530 1120 # swipe up
adb shell input text <lock-code> # input password
adb shell input keyevent 66 # press enter
@virtualprodigy
Copy link
Author

In my case, my organization's security rules forces the phone screen to lock in a minute & keep the phone awake when connected to usb is disabled. This little shell script will at least allow devs to unlock their test devices by running this little script. It beats typing it on the phone, especially if you work like me and use Genymotion's Scrcpy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment