add show all devices script

This commit is contained in:
2022-09-12 22:53:50 +02:00
parent 5046898b63
commit a56649e3a7
+18
View File
@@ -0,0 +1,18 @@
const {_android: android} = require('playwright');
const {exec} = require("child_process");
android.devices().then((devices) => {
devices.forEach((device) => {
exec("scrcpy -s " + device.serial(), (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
});
})
})