use adb to open url

This commit is contained in:
2023-10-28 17:02:09 +02:00
parent 0f56670774
commit 8160ca02f3
4 changed files with 79 additions and 72 deletions
+9 -1
View File
@@ -33,6 +33,14 @@ function cmdExecute(command) {
});
}
async function openUrlWithAdb(url, device) {
// do not continue if device is blocked
console.log("load url on device " + device.model() + " url=" + url)
let cmd = "adb -s " + device.serial() + " shell am start -a android.intent.action.VIEW -d " + url
let output = await cmdExecute(cmd);
console.log(`stdout: ${output}`);
}
async function findText(imgPath) {
// Load images
let cmd = `${baseDir}/venv/bin/python ${baseDir}/MacOCR.py ${imgPath}`
@@ -41,4 +49,4 @@ async function findText(imgPath) {
return stdOut
}
module.exports = findText
module.exports = {findText, openUrlWithAdb}