Skip to content

Instantly share code, notes, and snippets.

@twmht
Created June 11, 2015 05:13
Show Gist options
  • Save twmht/b2a0bb1e304a788667f4 to your computer and use it in GitHub Desktop.
Save twmht/b2a0bb1e304a788667f4 to your computer and use it in GitHub Desktop.
unlock the device
if [ "$(adb shell dumpsys power | grep mScreenOn= | grep -oE '(true|false)')" == false ] ; then
echo "Screen is off. Turning on."
adb shell input keyevent 26 # wakeup
adb shell input keyevent 82 # unlock
echo "OK, should be on now."
else
echo "Screen is already on."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment