Using the ADB command to get the phone lock screen status, you can use the following instructions:
1.adb Shell Dumpsys window policy^|grep Isstatusbarkeyguard
2.adb Shell Dumpsys window policy^|grep Mshowinglockscreen
Run the 1th command to get the result, as follows:
Isstatusbarkeyguard=false mfocusedwindow=window{3c2b801 u0 Com.tencent.mm/com.tencent.mm.ui.launcherui}
Mshowinglockscreen=false Mshowingdream=false Mdreaminglockscreen=false
Run the 2nd command to get the result, as follows:
Isstatusbarkeyguard=true mfocusedwindow=window{241b4081 u0 StatusBar}
Mshowinglockscreen=true Mshowingdream=false Mdreaminglockscreen=true
Unlocked status Value:
Isstatusbarkeyguard=false
Mshowinglockscreen=false
If the above 2 instruction has a command output value NULL, then take
Isstatusbarkeyguard=false
Or
Mshowinglockscreen=false
As a judgment.
You can also enable the phone to unlock the screen according to the following actions
Light screen
ADB Shell Inputkeyevent 26
KeyEvent 26 means click Power
Unlock
ADB shell Inputswipe 500 50 500 700
Swipe slide, swipe from 500,50 to 500,700
Detects if the phone screen is unlocked by a light screen