Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ADB Key event 82 for unlocking the Android device screen is not working for KK device

Tags:

android

adb

I am using following adb shell command for unlocking the device screen.

adb shell input keyevent 82

This is working fine for My enterprise device which has Android L device. However, when I used this same command for device with Kit Kat OS, it is not working. The screen has a Lock icon and circle around it, and i have to swipe it up.

Please suggest if an alternate commands.

like image 467
Humble_PrOgRaMeR Avatar asked Aug 10 '17 09:08

Humble_PrOgRaMeR


1 Answers

You can maybe detect the SDK version and if it is kitkat and below, you can use the below code to swipe.

SDK=`adb -s $i shell getprop ro.build.version.sdk | tr -d '\r'
if (( "$SDK" <= 19 )) ; then
adb shell input swipe 200 500 200 0
fi

You can tweak the parameters against swipe to get the exact start (x,y) and end (x,y) according to the screen you are using.

like image 58
Shredder Avatar answered Oct 14 '22 09:10

Shredder