diff --git a/common/src/main/java/com/microsoft/hydralab/common/management/AppiumServerManager.java b/common/src/main/java/com/microsoft/hydralab/common/management/AppiumServerManager.java index ca68ed145..849b7ed9b 100644 --- a/common/src/main/java/com/microsoft/hydralab/common/management/AppiumServerManager.java +++ b/common/src/main/java/com/microsoft/hydralab/common/management/AppiumServerManager.java @@ -287,7 +287,9 @@ public Boolean isDriverAlive(AppiumDriver driver) { public Boolean isDriverAlive(IOSDriver driver) { try { - driver.unlockDevice(); + // use getBatteryInfo to check if driver is alive + // getStatus would return from cache when session was closed and can't check if driver is alive + driver.getBatteryInfo(); return true; } catch (WebDriverException e) { return false; diff --git a/common/src/main/java/com/microsoft/hydralab/common/management/device/impl/IOSDeviceDriver.java b/common/src/main/java/com/microsoft/hydralab/common/management/device/impl/IOSDeviceDriver.java index 7e3c3aba5..fd0058281 100644 --- a/common/src/main/java/com/microsoft/hydralab/common/management/device/impl/IOSDeviceDriver.java +++ b/common/src/main/java/com/microsoft/hydralab/common/management/device/impl/IOSDeviceDriver.java @@ -82,8 +82,8 @@ public void screenCapture(@NotNull DeviceInfo deviceInfo, @NotNull String path, @Override public void wakeUpDevice(DeviceInfo deviceInfo, Logger logger) { - classLogger.info("Unlocking may not work as expected, please keep your device wake."); - getAppiumServerManager().getIOSDriver(deviceInfo, logger).unlockDevice(); + // unlockDevice can wake up device, but sometimes it would make the phone go back to home which is not expected + classLogger.info("Nothing Implemented for iOS in " + currentMethodName()); } @Override