dsh-mobilecode 0.4.0 → 0.6.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/README.md +57 -1
- package/lib/android-stream.js +3 -4
- package/lib/client.js +1054 -961
- package/lib/device-build.js +255 -18
- package/lib/index.js +559 -18
- package/lib/uitree.js +4 -4
- package/package.json +2 -2
package/lib/uitree.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Ported design credit: ZSeven-W/dsh-android (MIT) src/uitree.ts.
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
-
import { adb,
|
|
16
|
+
import { adb, adbRun, exec } from "./device-build.js"
|
|
17
17
|
|
|
18
18
|
const DUMP_TIMEOUT_MS = 60_000
|
|
19
19
|
const DUMP_MAX_BYTES = 8 * 1024 * 1024
|
|
@@ -260,7 +260,7 @@ export async function dumpUiTreeXml(serial) {
|
|
|
260
260
|
let primaryFailure
|
|
261
261
|
for (let attempt = 0; attempt < 2; attempt += 1) {
|
|
262
262
|
try {
|
|
263
|
-
const buffer = await
|
|
263
|
+
const buffer = await adbRun(serial, ["exec-out", "uiautomator", "dump", "/dev/tty"], options)
|
|
264
264
|
if (buffer === "") throw new Error("the device produced no output")
|
|
265
265
|
return extractHierarchyXml(buffer)
|
|
266
266
|
} catch (error) {
|
|
@@ -284,8 +284,8 @@ export async function dumpUiTreeXml(serial) {
|
|
|
284
284
|
}
|
|
285
285
|
const remotePath = "/sdcard/window_dump.xml"
|
|
286
286
|
try {
|
|
287
|
-
const notice = await
|
|
288
|
-
const buffer = await
|
|
287
|
+
const notice = await adbRun(serial, ["shell", "uiautomator", "dump", remotePath], options)
|
|
288
|
+
const buffer = await adbRun(serial, ["exec-out", "cat", remotePath], options)
|
|
289
289
|
const xml = extractHierarchyXml(buffer)
|
|
290
290
|
await exec(adb(), ["-s", serial, "shell", "rm", "-f", remotePath]).exit.catch(() => {})
|
|
291
291
|
if (xml.trim() === "") throw new Error(notice.trim() || "empty dump")
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-mobilecode",
|
|
3
|
-
"description": "MobileCode for the dsh web GUI: detect iOS/Android projects, run
|
|
4
|
-
"version": "0.
|
|
3
|
+
"description": "MobileCode for the dsh web GUI: detect iOS/Android projects, run preview servers, and drive the simulator/emulator from the session — 24 agent tools (device_run, device_screen, device_ui_tree, device_tap_element, device_wait_for, device_scroll_to, device_input, device_intent, device_connect, device_pair_qr, device_perf, device_app_info, device_install, device_uninstall, device_reboot, device_log, live screen stream, multimodal screenshots) with one classified adb boundary and a Wi-Fi connect/pair QR flow in the Connection settings tab. Hot-pluggable — mounted via the profile bundle list + cordis.patch.yml, no dsh source changes.",
|
|
4
|
+
"version": "0.6.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"packageManager": "pnpm@11.22.0",
|
|
7
7
|
"engines": {
|