use adb to take screenshot

This commit is contained in:
Lei PAN
2023-10-23 16:44:53 +02:00
parent 8f8e1c5f87
commit a36a9cf7cb
3 changed files with 23 additions and 11 deletions
+10 -3
View File
@@ -83,6 +83,10 @@ class CommandorPage {
async connect_to_browser(ocrResult) {
console.log("connect_to_browser() called");
if (this.browser === undefined) {
this.isTerminated = true
return
}
console.log("browser.isConnected: " + this.browser.isConnected());
if (!this.browser.isConnected()) {
this.browser = await puppeteer.connect({
@@ -980,9 +984,10 @@ class CommandorPage {
await this.checkResultWithOcr();
break;
case OCRResult.BRAVE_PRIVACY:
if (this.device.model() === "MI 5s")
await this.device.shell("input tap " + 530 + " " + 970)
else if (this.device.model() === "ONEPLUS A6000")
if (this.device.model() === "MI 5s") {
await this.tapForDevice(this.device, 530, 970)
// await this.device.shell("input tap " + 530 + " " + 970)
} else if (this.device.model() === "ONEPLUS A6000")
await this.device.shell("input tap " + 530 + " " + 1064)
else if (this.device.model() === "KB2003")
await this.tapForDevice(this.device, 500, 1200)
@@ -1124,6 +1129,8 @@ class CommandorPage {
this.device.shell("input tap " + 900 + " " + 1532)
} else if (this.device.model() === "MI 5s") {
this.device.shell("input tap " + 925 + " " + 1325)
} else if (this.device.model() === "22041219PG") {
this.device.shell("input tap " + 925 + " " + 1430)
} else
this.device.shell("input tap " + 933 + " " + 1538)
await delay(2000);