@midscene/android 1.10.9-beta-20260804015945.0 → 1.10.9
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/cli.mjs +21 -12
- package/dist/es/index.mjs +20 -11
- package/dist/lib/cli.js +21 -12
- package/dist/lib/index.js +20 -11
- package/dist/types/index.d.ts +2 -2
- package/package.json +4 -4
package/dist/es/cli.mjs
CHANGED
|
@@ -99,20 +99,12 @@ var __webpack_modules__ = {
|
|
|
99
99
|
try {
|
|
100
100
|
this.isConnecting = true;
|
|
101
101
|
debugScrcpy('Starting scrcpy connection...');
|
|
102
|
-
const { AdbScrcpyClient
|
|
102
|
+
const { AdbScrcpyClient } = await import("@yume-chan/adb-scrcpy");
|
|
103
103
|
const { ReadableStream } = await import("@yume-chan/stream-extra");
|
|
104
104
|
const { DefaultServerPath } = await import("@yume-chan/scrcpy");
|
|
105
105
|
const serverBinPath = this.resolveServerBinPath();
|
|
106
106
|
await AdbScrcpyClient.pushServer(this.adb, ReadableStream.from((0, node_fs__rspack_import_0.createReadStream)(serverBinPath)));
|
|
107
|
-
const scrcpyOptions =
|
|
108
|
-
audio: false,
|
|
109
|
-
control: false,
|
|
110
|
-
maxSize: this.options.maxSize,
|
|
111
|
-
videoBitRate: this.options.videoBitRate,
|
|
112
|
-
maxFps: 10,
|
|
113
|
-
sendFrameMeta: true,
|
|
114
|
-
videoCodecOptions: 'i-frame-interval=0,bitrate-mode=2'
|
|
115
|
-
});
|
|
107
|
+
const scrcpyOptions = await this.createScrcpyOptions();
|
|
116
108
|
this.scrcpyClient = await AdbScrcpyClient.start(this.adb, DefaultServerPath, scrcpyOptions);
|
|
117
109
|
serverOutputTask = this.collectServerOutput(this.scrcpyClient.output, serverOutput);
|
|
118
110
|
const videoStreamPromise = this.scrcpyClient.videoStream;
|
|
@@ -140,6 +132,23 @@ var __webpack_modules__ = {
|
|
|
140
132
|
this.isConnecting = false;
|
|
141
133
|
}
|
|
142
134
|
}
|
|
135
|
+
async createScrcpyOptions() {
|
|
136
|
+
const [{ AdbScrcpyOptions3_3_3 }, { ScrcpyInstanceId }] = await Promise.all([
|
|
137
|
+
import("@yume-chan/adb-scrcpy"),
|
|
138
|
+
import("@yume-chan/scrcpy")
|
|
139
|
+
]);
|
|
140
|
+
return new AdbScrcpyOptions3_3_3({
|
|
141
|
+
audio: false,
|
|
142
|
+
control: false,
|
|
143
|
+
tunnelForward: true,
|
|
144
|
+
scid: ScrcpyInstanceId.random(),
|
|
145
|
+
maxSize: this.options.maxSize,
|
|
146
|
+
videoBitRate: this.options.videoBitRate,
|
|
147
|
+
maxFps: 10,
|
|
148
|
+
sendFrameMeta: true,
|
|
149
|
+
videoCodecOptions: 'i-frame-interval=0,bitrate-mode=2'
|
|
150
|
+
});
|
|
151
|
+
}
|
|
143
152
|
async collectServerOutput(output, lines) {
|
|
144
153
|
const reader = output.getReader();
|
|
145
154
|
try {
|
|
@@ -1688,7 +1697,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1688
1697
|
debugDevice('screenshotBase64 end (scrcpy mode)');
|
|
1689
1698
|
return result;
|
|
1690
1699
|
} catch (error) {
|
|
1691
|
-
|
|
1700
|
+
warnDevice(`Scrcpy screenshot failed, falling back to standard ADB method.\nError: ${error}`);
|
|
1692
1701
|
}
|
|
1693
1702
|
const adb = await this.getAdb();
|
|
1694
1703
|
let screenshotBuffer;
|
|
@@ -2576,7 +2585,7 @@ class AndroidMidsceneTools extends BaseMidsceneTools {
|
|
|
2576
2585
|
const tools = new AndroidMidsceneTools();
|
|
2577
2586
|
runToolsCLI(tools, 'midscene-android', {
|
|
2578
2587
|
stripPrefix: 'android_',
|
|
2579
|
-
version: "1.10.9
|
|
2588
|
+
version: "1.10.9",
|
|
2580
2589
|
extraCommands: createReportCliCommands()
|
|
2581
2590
|
}).catch((e)=>{
|
|
2582
2591
|
process.exit(reportCLIError(e));
|
package/dist/es/index.mjs
CHANGED
|
@@ -98,20 +98,12 @@ var __webpack_modules__ = {
|
|
|
98
98
|
try {
|
|
99
99
|
this.isConnecting = true;
|
|
100
100
|
debugScrcpy('Starting scrcpy connection...');
|
|
101
|
-
const { AdbScrcpyClient
|
|
101
|
+
const { AdbScrcpyClient } = await import("@yume-chan/adb-scrcpy");
|
|
102
102
|
const { ReadableStream } = await import("@yume-chan/stream-extra");
|
|
103
103
|
const { DefaultServerPath } = await import("@yume-chan/scrcpy");
|
|
104
104
|
const serverBinPath = this.resolveServerBinPath();
|
|
105
105
|
await AdbScrcpyClient.pushServer(this.adb, ReadableStream.from((0, node_fs__rspack_import_0.createReadStream)(serverBinPath)));
|
|
106
|
-
const scrcpyOptions =
|
|
107
|
-
audio: false,
|
|
108
|
-
control: false,
|
|
109
|
-
maxSize: this.options.maxSize,
|
|
110
|
-
videoBitRate: this.options.videoBitRate,
|
|
111
|
-
maxFps: 10,
|
|
112
|
-
sendFrameMeta: true,
|
|
113
|
-
videoCodecOptions: 'i-frame-interval=0,bitrate-mode=2'
|
|
114
|
-
});
|
|
106
|
+
const scrcpyOptions = await this.createScrcpyOptions();
|
|
115
107
|
this.scrcpyClient = await AdbScrcpyClient.start(this.adb, DefaultServerPath, scrcpyOptions);
|
|
116
108
|
serverOutputTask = this.collectServerOutput(this.scrcpyClient.output, serverOutput);
|
|
117
109
|
const videoStreamPromise = this.scrcpyClient.videoStream;
|
|
@@ -139,6 +131,23 @@ var __webpack_modules__ = {
|
|
|
139
131
|
this.isConnecting = false;
|
|
140
132
|
}
|
|
141
133
|
}
|
|
134
|
+
async createScrcpyOptions() {
|
|
135
|
+
const [{ AdbScrcpyOptions3_3_3 }, { ScrcpyInstanceId }] = await Promise.all([
|
|
136
|
+
import("@yume-chan/adb-scrcpy"),
|
|
137
|
+
import("@yume-chan/scrcpy")
|
|
138
|
+
]);
|
|
139
|
+
return new AdbScrcpyOptions3_3_3({
|
|
140
|
+
audio: false,
|
|
141
|
+
control: false,
|
|
142
|
+
tunnelForward: true,
|
|
143
|
+
scid: ScrcpyInstanceId.random(),
|
|
144
|
+
maxSize: this.options.maxSize,
|
|
145
|
+
videoBitRate: this.options.videoBitRate,
|
|
146
|
+
maxFps: 10,
|
|
147
|
+
sendFrameMeta: true,
|
|
148
|
+
videoCodecOptions: 'i-frame-interval=0,bitrate-mode=2'
|
|
149
|
+
});
|
|
150
|
+
}
|
|
142
151
|
async collectServerOutput(output, lines) {
|
|
143
152
|
const reader = output.getReader();
|
|
144
153
|
try {
|
|
@@ -1591,7 +1600,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1591
1600
|
debugDevice('screenshotBase64 end (scrcpy mode)');
|
|
1592
1601
|
return result;
|
|
1593
1602
|
} catch (error) {
|
|
1594
|
-
|
|
1603
|
+
warnDevice(`Scrcpy screenshot failed, falling back to standard ADB method.\nError: ${error}`);
|
|
1595
1604
|
}
|
|
1596
1605
|
const adb = await this.getAdb();
|
|
1597
1606
|
let screenshotBuffer;
|
package/dist/lib/cli.js
CHANGED
|
@@ -87,20 +87,12 @@ var __webpack_modules__ = {
|
|
|
87
87
|
try {
|
|
88
88
|
this.isConnecting = true;
|
|
89
89
|
debugScrcpy('Starting scrcpy connection...');
|
|
90
|
-
const { AdbScrcpyClient
|
|
90
|
+
const { AdbScrcpyClient } = await import("@yume-chan/adb-scrcpy");
|
|
91
91
|
const { ReadableStream } = await import("@yume-chan/stream-extra");
|
|
92
92
|
const { DefaultServerPath } = await import("@yume-chan/scrcpy");
|
|
93
93
|
const serverBinPath = this.resolveServerBinPath();
|
|
94
94
|
await AdbScrcpyClient.pushServer(this.adb, ReadableStream.from((0, node_fs__rspack_import_0.createReadStream)(serverBinPath)));
|
|
95
|
-
const scrcpyOptions =
|
|
96
|
-
audio: false,
|
|
97
|
-
control: false,
|
|
98
|
-
maxSize: this.options.maxSize,
|
|
99
|
-
videoBitRate: this.options.videoBitRate,
|
|
100
|
-
maxFps: 10,
|
|
101
|
-
sendFrameMeta: true,
|
|
102
|
-
videoCodecOptions: 'i-frame-interval=0,bitrate-mode=2'
|
|
103
|
-
});
|
|
95
|
+
const scrcpyOptions = await this.createScrcpyOptions();
|
|
104
96
|
this.scrcpyClient = await AdbScrcpyClient.start(this.adb, DefaultServerPath, scrcpyOptions);
|
|
105
97
|
serverOutputTask = this.collectServerOutput(this.scrcpyClient.output, serverOutput);
|
|
106
98
|
const videoStreamPromise = this.scrcpyClient.videoStream;
|
|
@@ -128,6 +120,23 @@ var __webpack_modules__ = {
|
|
|
128
120
|
this.isConnecting = false;
|
|
129
121
|
}
|
|
130
122
|
}
|
|
123
|
+
async createScrcpyOptions() {
|
|
124
|
+
const [{ AdbScrcpyOptions3_3_3 }, { ScrcpyInstanceId }] = await Promise.all([
|
|
125
|
+
import("@yume-chan/adb-scrcpy"),
|
|
126
|
+
import("@yume-chan/scrcpy")
|
|
127
|
+
]);
|
|
128
|
+
return new AdbScrcpyOptions3_3_3({
|
|
129
|
+
audio: false,
|
|
130
|
+
control: false,
|
|
131
|
+
tunnelForward: true,
|
|
132
|
+
scid: ScrcpyInstanceId.random(),
|
|
133
|
+
maxSize: this.options.maxSize,
|
|
134
|
+
videoBitRate: this.options.videoBitRate,
|
|
135
|
+
maxFps: 10,
|
|
136
|
+
sendFrameMeta: true,
|
|
137
|
+
videoCodecOptions: 'i-frame-interval=0,bitrate-mode=2'
|
|
138
|
+
});
|
|
139
|
+
}
|
|
131
140
|
async collectServerOutput(output, lines) {
|
|
132
141
|
const reader = output.getReader();
|
|
133
142
|
try {
|
|
@@ -1703,7 +1712,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1703
1712
|
debugDevice('screenshotBase64 end (scrcpy mode)');
|
|
1704
1713
|
return result;
|
|
1705
1714
|
} catch (error) {
|
|
1706
|
-
|
|
1715
|
+
warnDevice(`Scrcpy screenshot failed, falling back to standard ADB method.\nError: ${error}`);
|
|
1707
1716
|
}
|
|
1708
1717
|
const adb = await this.getAdb();
|
|
1709
1718
|
let screenshotBuffer;
|
|
@@ -2591,7 +2600,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
2591
2600
|
const tools = new AndroidMidsceneTools();
|
|
2592
2601
|
(0, cli_namespaceObject.runToolsCLI)(tools, 'midscene-android', {
|
|
2593
2602
|
stripPrefix: 'android_',
|
|
2594
|
-
version: "1.10.9
|
|
2603
|
+
version: "1.10.9",
|
|
2595
2604
|
extraCommands: (0, core_namespaceObject.createReportCliCommands)()
|
|
2596
2605
|
}).catch((e)=>{
|
|
2597
2606
|
process.exit((0, cli_namespaceObject.reportCLIError)(e));
|
package/dist/lib/index.js
CHANGED
|
@@ -87,20 +87,12 @@ var __webpack_modules__ = {
|
|
|
87
87
|
try {
|
|
88
88
|
this.isConnecting = true;
|
|
89
89
|
debugScrcpy('Starting scrcpy connection...');
|
|
90
|
-
const { AdbScrcpyClient
|
|
90
|
+
const { AdbScrcpyClient } = await import("@yume-chan/adb-scrcpy");
|
|
91
91
|
const { ReadableStream } = await import("@yume-chan/stream-extra");
|
|
92
92
|
const { DefaultServerPath } = await import("@yume-chan/scrcpy");
|
|
93
93
|
const serverBinPath = this.resolveServerBinPath();
|
|
94
94
|
await AdbScrcpyClient.pushServer(this.adb, ReadableStream.from((0, node_fs__rspack_import_0.createReadStream)(serverBinPath)));
|
|
95
|
-
const scrcpyOptions =
|
|
96
|
-
audio: false,
|
|
97
|
-
control: false,
|
|
98
|
-
maxSize: this.options.maxSize,
|
|
99
|
-
videoBitRate: this.options.videoBitRate,
|
|
100
|
-
maxFps: 10,
|
|
101
|
-
sendFrameMeta: true,
|
|
102
|
-
videoCodecOptions: 'i-frame-interval=0,bitrate-mode=2'
|
|
103
|
-
});
|
|
95
|
+
const scrcpyOptions = await this.createScrcpyOptions();
|
|
104
96
|
this.scrcpyClient = await AdbScrcpyClient.start(this.adb, DefaultServerPath, scrcpyOptions);
|
|
105
97
|
serverOutputTask = this.collectServerOutput(this.scrcpyClient.output, serverOutput);
|
|
106
98
|
const videoStreamPromise = this.scrcpyClient.videoStream;
|
|
@@ -128,6 +120,23 @@ var __webpack_modules__ = {
|
|
|
128
120
|
this.isConnecting = false;
|
|
129
121
|
}
|
|
130
122
|
}
|
|
123
|
+
async createScrcpyOptions() {
|
|
124
|
+
const [{ AdbScrcpyOptions3_3_3 }, { ScrcpyInstanceId }] = await Promise.all([
|
|
125
|
+
import("@yume-chan/adb-scrcpy"),
|
|
126
|
+
import("@yume-chan/scrcpy")
|
|
127
|
+
]);
|
|
128
|
+
return new AdbScrcpyOptions3_3_3({
|
|
129
|
+
audio: false,
|
|
130
|
+
control: false,
|
|
131
|
+
tunnelForward: true,
|
|
132
|
+
scid: ScrcpyInstanceId.random(),
|
|
133
|
+
maxSize: this.options.maxSize,
|
|
134
|
+
videoBitRate: this.options.videoBitRate,
|
|
135
|
+
maxFps: 10,
|
|
136
|
+
sendFrameMeta: true,
|
|
137
|
+
videoCodecOptions: 'i-frame-interval=0,bitrate-mode=2'
|
|
138
|
+
});
|
|
139
|
+
}
|
|
131
140
|
async collectServerOutput(output, lines) {
|
|
132
141
|
const reader = output.getReader();
|
|
133
142
|
try {
|
|
@@ -1624,7 +1633,7 @@ ${Object.keys(size).filter((key)=>size[key]).map((key)=>` ${key} size: ${size[k
|
|
|
1624
1633
|
debugDevice('screenshotBase64 end (scrcpy mode)');
|
|
1625
1634
|
return result;
|
|
1626
1635
|
} catch (error) {
|
|
1627
|
-
|
|
1636
|
+
warnDevice(`Scrcpy screenshot failed, falling back to standard ADB method.\nError: ${error}`);
|
|
1628
1637
|
}
|
|
1629
1638
|
const adb = await this.getAdb();
|
|
1630
1639
|
let screenshotBuffer;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -399,8 +399,7 @@ export declare class ScrcpyDeviceAdapter {
|
|
|
399
399
|
* Resolve scrcpy config.
|
|
400
400
|
* maxSize defaults to 0 (no scaling, full physical resolution) so the Agent layer
|
|
401
401
|
* receives the highest quality image for AI processing.
|
|
402
|
-
* videoBitRate
|
|
403
|
-
* sufficient quality for all-I-frame H.264 encoding.
|
|
402
|
+
* videoBitRate uses the shared default unless explicitly configured.
|
|
404
403
|
*/
|
|
405
404
|
resolveConfig(deviceInfo: DevicePhysicalInfo): ResolvedScrcpyConfig;
|
|
406
405
|
/**
|
|
@@ -474,6 +473,7 @@ declare class ScrcpyScreenshotManager {
|
|
|
474
473
|
* Ensure scrcpy connection is active
|
|
475
474
|
*/
|
|
476
475
|
ensureConnected(): Promise<void>;
|
|
476
|
+
private createScrcpyOptions;
|
|
477
477
|
private collectServerOutput;
|
|
478
478
|
private createConnectionError;
|
|
479
479
|
private getErrorOutput;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midscene/android",
|
|
3
|
-
"version": "1.10.9
|
|
3
|
+
"version": "1.10.9",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/web-infra-dev/midscene.git",
|
|
@@ -41,8 +41,8 @@
|
|
|
41
41
|
"@yume-chan/stream-extra": "2.1.0",
|
|
42
42
|
"appium-adb": "12.12.1",
|
|
43
43
|
"sharp": "^0.34.3",
|
|
44
|
-
"@midscene/core": "1.10.9
|
|
45
|
-
"@midscene/shared": "1.10.9
|
|
44
|
+
"@midscene/core": "1.10.9",
|
|
45
|
+
"@midscene/shared": "1.10.9"
|
|
46
46
|
},
|
|
47
47
|
"optionalDependencies": {
|
|
48
48
|
"@ffmpeg-installer/ffmpeg": "^1.1.0"
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"undici": "^6.0.0",
|
|
57
57
|
"vitest": "3.0.5",
|
|
58
58
|
"zod": "^3.25.1",
|
|
59
|
-
"@midscene/playground": "1.10.9
|
|
59
|
+
"@midscene/playground": "1.10.9"
|
|
60
60
|
},
|
|
61
61
|
"license": "MIT",
|
|
62
62
|
"scripts": {
|