@midscene/android-playground 1.0.1-beta-20251202152706.0 → 1.0.1-beta-20251203125942.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/bin.mjs +8 -15
- package/dist/lib/bin.js +7 -14
- package/package.json +5 -5
- package/static/index.html +1 -1
- package/static/static/js/{index.c9fbbbbd.js → index.1738123e.js} +5 -5
- package/static/static/js/index.1738123e.js.map +1 -0
- package/static/static/js/index.c9fbbbbd.js.map +0 -1
- /package/static/static/js/{index.c9fbbbbd.js.LICENSE.txt → index.1738123e.js.LICENSE.txt} +0 -0
package/dist/es/bin.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { createServer } from "node:net";
|
|
|
3
3
|
import node_path from "node:path";
|
|
4
4
|
import { promisify } from "node:util";
|
|
5
5
|
import { select as prompts_select } from "@inquirer/prompts";
|
|
6
|
-
import { AndroidAgent, AndroidDevice } from "@midscene/android";
|
|
6
|
+
import { AndroidAgent, AndroidDevice, getConnectedDevices } from "@midscene/android";
|
|
7
7
|
import { PlaygroundServer } from "@midscene/playground";
|
|
8
8
|
import { PLAYGROUND_SERVER_PORT, SCRCPY_SERVER_PORT } from "@midscene/shared/constants";
|
|
9
9
|
import { createReadStream } from "node:fs";
|
|
@@ -363,7 +363,7 @@ class ScrcpyServer {
|
|
|
363
363
|
this.setupApiRoutes();
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
|
-
|
|
366
|
+
promisify(exec);
|
|
367
367
|
async function isPortAvailable(port) {
|
|
368
368
|
return new Promise((resolve)=>{
|
|
369
369
|
const server = createServer();
|
|
@@ -389,19 +389,12 @@ async function findAvailablePort(startPort) {
|
|
|
389
389
|
}
|
|
390
390
|
async function getAdbDevices() {
|
|
391
391
|
try {
|
|
392
|
-
await
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
id: parts[0],
|
|
399
|
-
status: parts[1],
|
|
400
|
-
name: parts[0]
|
|
401
|
-
};
|
|
402
|
-
return null;
|
|
403
|
-
}).filter((device)=>null !== device && 'device' === device.status);
|
|
404
|
-
return devices;
|
|
392
|
+
const devices = await getConnectedDevices();
|
|
393
|
+
return devices.filter((device)=>'device' === device.state).map((device)=>({
|
|
394
|
+
id: device.udid,
|
|
395
|
+
status: device.state,
|
|
396
|
+
name: device.udid
|
|
397
|
+
}));
|
|
405
398
|
} catch (error) {
|
|
406
399
|
console.error('Error getting ADB devices:', error);
|
|
407
400
|
return [];
|
package/dist/lib/bin.js
CHANGED
|
@@ -389,7 +389,7 @@ class ScrcpyServer {
|
|
|
389
389
|
this.setupApiRoutes();
|
|
390
390
|
}
|
|
391
391
|
}
|
|
392
|
-
|
|
392
|
+
(0, external_node_util_namespaceObject.promisify)(external_node_child_process_namespaceObject.exec);
|
|
393
393
|
async function isPortAvailable(port) {
|
|
394
394
|
return new Promise((resolve)=>{
|
|
395
395
|
const server = (0, external_node_net_namespaceObject.createServer)();
|
|
@@ -415,19 +415,12 @@ async function findAvailablePort(startPort) {
|
|
|
415
415
|
}
|
|
416
416
|
async function getAdbDevices() {
|
|
417
417
|
try {
|
|
418
|
-
await
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
id: parts[0],
|
|
425
|
-
status: parts[1],
|
|
426
|
-
name: parts[0]
|
|
427
|
-
};
|
|
428
|
-
return null;
|
|
429
|
-
}).filter((device)=>null !== device && 'device' === device.status);
|
|
430
|
-
return devices;
|
|
418
|
+
const devices = await (0, android_namespaceObject.getConnectedDevices)();
|
|
419
|
+
return devices.filter((device)=>'device' === device.state).map((device)=>({
|
|
420
|
+
id: device.udid,
|
|
421
|
+
status: device.state,
|
|
422
|
+
name: device.udid
|
|
423
|
+
}));
|
|
431
424
|
} catch (error) {
|
|
432
425
|
console.error('Error getting ADB devices:', error);
|
|
433
426
|
return [];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/android-playground",
|
|
3
|
-
"version": "1.0.1-beta-
|
|
3
|
+
"version": "1.0.1-beta-20251203125942.0",
|
|
4
4
|
"description": "Android playground for Midscene",
|
|
5
5
|
"main": "./dist/lib/index.js",
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"@inquirer/prompts": "^7.8.6",
|
|
27
27
|
"open": "10.1.0",
|
|
28
28
|
"socket.io": "^4.8.1",
|
|
29
|
-
"@midscene/
|
|
30
|
-
"@midscene/
|
|
31
|
-
"@midscene/
|
|
32
|
-
"@midscene/
|
|
29
|
+
"@midscene/core": "1.0.1-beta-20251203125942.0",
|
|
30
|
+
"@midscene/playground": "1.0.1-beta-20251203125942.0",
|
|
31
|
+
"@midscene/shared": "1.0.1-beta-20251203125942.0",
|
|
32
|
+
"@midscene/android": "1.0.1-beta-20251203125942.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@rslib/core": "^0.18.2",
|
package/static/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html><head><title>Midscene Android Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.d7dec362.js"></script><script defer src="/static/js/9.1bed77ad.js"></script><script defer src="/static/js/index.
|
|
1
|
+
<!doctype html><html><head><title>Midscene Android Playground</title><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><script defer src="/static/js/lib-react.d7dec362.js"></script><script defer src="/static/js/9.1bed77ad.js"></script><script defer src="/static/js/index.1738123e.js"></script><link href="/static/css/index.d686b8b9.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
|