Merge branch 'master' into feature/scheduler

This commit is contained in:
2023-02-07 20:34:50 +01:00
8 changed files with 193 additions and 8 deletions
+28
View File
@@ -0,0 +1,28 @@
const {exec} = require("child_process");
const regexDevices = /[a-zA-Z0-9]/g
exec("adb devices ", (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
// find the device id from output
// let matchedDeviceIds = regexDevices.exec(stdout)
regexDevices.global = true
let matchedDeviceIds = stdout.matchAll(regexDevices);
for (m in matchedDeviceIds) {
console.log(m);
}
console.log(matchedDeviceIds)
// var m;
// do {
// let m = regexDevices.exec(stdout);
// if (m) {
// console.log(m[1], m[2]);
// }
// } while (m);
});