appium-报错解决(三)代码中执行adb报错

在代码中执行adb命令

        String cmd="adb shell input keyevent 4";

        try {
            Runtime.getRuntime().exec(cmd).waitFor();
            Thread.sleep(10000);
        } catch (Exception e) {
            e.printStackTrace();
        }

结果一执行appium直接停止session,查文档发现如果要执行cmd,需要执行appium destop时勾选下面选项
或者

appium --relaxed-security -U udid

appium-报错解决(三)代码中执行adb报错_第1张图片

你可能感兴趣的:(Appium)