|
@@ -13,6 +13,7 @@ import net.mooctest.www.android_auto_test.common.exceptions.HttpNotFoundExceptio
|
|
|
import net.mooctest.www.android_auto_test.common.exceptions.NoFreeDeviceException;
|
|
|
import net.mooctest.www.android_auto_test.models.Device;
|
|
|
import net.mooctest.www.android_auto_test.services.*;
|
|
|
+import net.mooctest.www.android_auto_test.utils.OsUtil;
|
|
|
import net.mooctest.www.android_auto_test.utils.PrintUtil;
|
|
|
import net.mooctest.www.android_auto_test.vo.DeviceStatusResult;
|
|
|
import net.mooctest.www.android_auto_test.vo.TraceMetaInfo;
|
|
@@ -166,4 +167,19 @@ public class AutoTestServiceImpl implements AutoTestService {
|
|
|
}
|
|
|
throw new HttpNotFoundException(String.format("TraceId [%s] 不存在", traceId));
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean stopDevice(String udid) {
|
|
|
+ new Thread(() -> {
|
|
|
+ try {
|
|
|
+ String command = String.format("adb -s %s reconnect", udid);
|
|
|
+ OsUtil.runCommand(command);
|
|
|
+ Thread.sleep(5000);
|
|
|
+ OsUtil.runCommand(OsUtil.getCmd() + " Commands/stopAppium.sh " + udid);
|
|
|
+ } catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }).start();
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|