fix: swipe up to unlock device

This commit is contained in:
lilong.129
2024-12-18 21:41:50 +08:00
parent 5f8835a60a
commit b1eda1abc1
2 changed files with 5 additions and 3 deletions

View File

@@ -1 +1 @@
v5.0.0+2412181803 v5.0.0+2412182148

View File

@@ -195,9 +195,11 @@ func (dev *AndroidDevice) Init() error {
dev.d.RunShellCommand("rm", "-r", config.DeviceActionLogFilePath) dev.d.RunShellCommand("rm", "-r", config.DeviceActionLogFilePath)
// Notice: brighten should be executed before unlock // Notice: brighten should be executed before unlock
// brighten android device screen // brighten android device screen
dev.d.RunShellCommand("input", "keyevent", "224") dev.d.RunShellCommand("input", "keyevent", fmt.Sprintf("%d", KCWakeup))
// unlock android device screen // unlock android device screen
dev.d.RunShellCommand("input", "keyevent", "82") dev.d.RunShellCommand("input", "keyevent", fmt.Sprintf("%d", KCMenu))
// swipe up to unlock
dev.d.RunShellCommand("input", "swipe", "540", "1000", "540", "500")
if dev.UIA2 { if dev.UIA2 {
// uiautomator2 server must be started before // uiautomator2 server must be started before