问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/45609855/adb-key-event-82-for-unlocking-the-android-device-screen-is-not-working-for-kk-d