shell截图

``` //shell 截图方法 function jieTu() { let img = null let jieTuPath = "/sdcard/1.png" let jieTuStr = "screencap -p " + jieTuPath try { shell(jieTuStr, true) img = images.read(jieTuPath) // log("高", img.getHeight()) // log("宽", img.getWidth()) // app.viewFile(jieTuPath) return img } catch (error) { img.recycle() } } //用法 let img = jieTu() if (img) { let 游客登录 = images.findMultiColors(img, "#ffffff", [[50, 6, "#ffffff"], [25, 19, "#93e359"], [33, -4, "#8fe255"], [20, -10, "#5d993a"], [4, 16, "#fefefe"]], { region: [133, 405, 150, 129], threshold: [26] }) if (游客登录) { click(游客登录.x + 10, 游客登录.y) log("找到了并点击了游客登录按钮") } else { log("没找到了游客登录按钮") } sleep(5000) img.recycle() } ```