dsh-apk-vm 0.6.2 → 0.8.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/CHANGELOG.md +54 -0
- package/README.md +8 -3
- package/client.js +884 -16
- package/index.js +202 -7
- package/lib/aab.js +736 -0
- package/lib/android.js +95 -1
- package/lib/har.js +423 -0
- package/lib/ui-tests.js +393 -0
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,59 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.8.0
|
|
4
|
+
|
|
5
|
+
Sidebar workspace, APK debugging, network and regression tools.
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Collapsible tools aside**, **expand/full-window**, **in-app floating VM window**, remembered
|
|
10
|
+
expand state, double-click expand, keyboard `Esc` restore and a dedicated close button.
|
|
11
|
+
- **Multi-instance grid** with frame thumbnails and one-click instance switching.
|
|
12
|
+
- **Stream quality presets** (540p/30, 720p/60, 960p/60) that restart only the scrcpy session,
|
|
13
|
+
a quick rotate control, first-boot hint, and stale-client/version warning.
|
|
14
|
+
- **One-click environment setup** for SDK tools, system image and AVD creation with explicit
|
|
15
|
+
download confirmation; single-step setup actions remain available.
|
|
16
|
+
- **APK quick actions**: launch installed app, validated deep links, grant/revoke permissions,
|
|
17
|
+
plus existing stop/clear-data/uninstall. `.aab` uploads convert through bundletool when available.
|
|
18
|
+
- **Named VM snapshots**: save, restore and delete per-AVD snapshots.
|
|
19
|
+
- **Passive clipboard**: explicit “copy device clipboard to host” and “paste host clipboard to
|
|
20
|
+
device” actions; no polling, listeners or background sync.
|
|
21
|
+
- **HAR network panel**: load a HAR exported by an external proxy/DevTools, summarize status
|
|
22
|
+
classes/bytes/domains and inspect up to 500 requests with bounded fields.
|
|
23
|
+
- **UI check/visual baseline**: run UIAutomator assertions and SHA-256 screenshot baselines,
|
|
24
|
+
return a JSON/Markdown report, and copy a `curl` for HAR entries.
|
|
25
|
+
- **Remote adb host:port input** for attached network devices.
|
|
26
|
+
|
|
27
|
+
### Notes
|
|
28
|
+
|
|
29
|
+
- AAB conversion requires `bundletool` (executable, `BUNDLETOOL_JAR`, or a jar in the repo/tools dir).
|
|
30
|
+
- Visual regression is exact-byte baseline comparison; it does not ship a pixel-diff image library.
|
|
31
|
+
- Clipboard remains passive by design; there is no automatic sync.
|
|
32
|
+
|
|
33
|
+
## 0.7.0
|
|
34
|
+
|
|
35
|
+
Sidebar usability and streaming controls.
|
|
36
|
+
|
|
37
|
+
### Added
|
|
38
|
+
|
|
39
|
+
- **Expand / restore button** in the VM panel header. It turns the panel into a
|
|
40
|
+
full-window overlay so a narrow `dsh-better-sidebar` tab can show a large phone screen;
|
|
41
|
+
press Escape or click the button again to restore the sidebar layout. The last state is
|
|
42
|
+
remembered, double-clicking the phone toggles it, and the overlay has a dedicated close button.
|
|
43
|
+
- **Collapsible tools aside** in the embedded sidebar: APK/debug cards are hidden by default
|
|
44
|
+
so the phone gets the available height; a Tools button reveals them.
|
|
45
|
+
- **Stream quality presets** — Low 540p/30, Balanced 720p/60, High 960p/60. Changing the
|
|
46
|
+
preset restarts only the scrcpy session and lets the panel reconnect.
|
|
47
|
+
- Quick **rotate** and **first-boot hint** in the stage controls.
|
|
48
|
+
- **Version and stale-UI warning** — the header shows the client version, and a
|
|
49
|
+
client/host version mismatch offers a Reload UI action.
|
|
50
|
+
- **APK quick actions** — launch an installed app, open a validated deep link, grant/revoke a
|
|
51
|
+
permission, plus the existing stop/clear/uninstall controls.
|
|
52
|
+
- **One-click environment setup** — an explicit button chains SDK tools, system image,
|
|
53
|
+
AVD creation and VM start; the click confirms downloads even when global auto-download is off.
|
|
54
|
+
- **Passive clipboard** — host clipboard is read/written only when the user clicks
|
|
55
|
+
“paste host clipboard” or “copy device clipboard”. No polling or background sync.
|
|
56
|
+
|
|
3
57
|
## 0.6.2
|
|
4
58
|
|
|
5
59
|
Sidebar usability.
|
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
- **Agent-native** — `apk_vm` tools, a live UI Inspector, copy-ready selectors and record/replay flows.
|
|
28
28
|
- **Local and inspectable** — open-source AOSP emulator, rooted debug API, network/storage controls, no telemetry.
|
|
29
29
|
- **Expandable viewer** — turn the narrow sidebar panel into a full-window VM with one click; Escape restores it.
|
|
30
|
+
- **Large-screen controls** — collapsible tools, quality presets (540p/30 → 960p/60), double-click expand, quick rotate, and a stale-UI/version warning.
|
|
30
31
|
|
|
31
32
|
This repository contains the static DSH plugin `dsh-apk-vm`. It adds a first-class sidebar
|
|
32
33
|
entry ("APK Virtual Machine" / "APK 虚拟机") whose main panel boots an AOSP Android Emulator,
|
|
@@ -44,7 +45,7 @@ same-origin, loopback-only debug HTTP API and an `apk_vm` Agent tool.
|
|
|
44
45
|
> 当前 **Windows x64 与 Linux x86_64(headless)为端到端已验证平台**;macOS 仅做探测/CI
|
|
45
46
|
> 覆盖,详见 `docs/LINUX-E2E.md`。
|
|
46
47
|
|
|
47
|
-
**Status:** `0.
|
|
48
|
+
**Status:** `0.8.0` · Apache-2.0 · no npm runtime dependencies · no build step.
|
|
48
49
|
|
|
49
50
|
This is an open-source DSH plugin published on npm as **`dsh-apk-vm`**. Repository:
|
|
50
51
|
[github.com/yuxiaole-bili/dsh-apk-vm](https://github.com/yuxiaole-bili/dsh-apk-vm).
|
|
@@ -601,12 +602,16 @@ JSON bodies are bounded to 64 KiB; the raw APK upload is bounded to 500 MiB.
|
|
|
601
602
|
| POST | `/apk-vm/device` | `{"serial":"<adb-serial>"}` attach an online physical/network device; `{"serial":""}` detach and restore the managed AVD. |
|
|
602
603
|
| POST | `/apk-vm/vm` | `{"action":"start"\|"stop"\|"restart"\|"snapshot"}`. |
|
|
603
604
|
| POST | `/apk-vm/install` | `{"path":"C:/path/app.apk"}` → install + launch. |
|
|
604
|
-
| POST | `/apk-vm/upload` | Raw APK bytes (≤ 500 MiB) with the file name in the `x-apk-name` header → validate ZIP/APK magic, write to the OS temp dir, install + launch. |
|
|
605
|
+
| POST | `/apk-vm/upload` | Raw APK/APKS/XAPK/AAB bytes (≤ 500 MiB) with the file name in the `x-apk-name` header → validate ZIP/APK magic, write to the OS temp dir, install + launch. |
|
|
605
606
|
| GET | `/apk-vm/frame?t=…` | Latest PNG frame (`409` while the VM is not ready). |
|
|
606
607
|
| POST | `/apk-vm/input` | `tap` / `swipe` / `key` / `text` payloads. |
|
|
607
608
|
| POST | `/apk-vm/touch` | Multi-touch scrcpy control (`{"action":"down\|move\|up\|cancel","pointerId":0,"x":…,"y":…}` in video-frame coordinates) for pinch/zoom. |
|
|
608
|
-
| GET/POST | `/apk-vm/clipboard` | Read the device clipboard (`GET`, scrcpy `GET_CLIPBOARD`) or write text (`POST {"text":…}`). |
|
|
609
|
+
| GET/POST | `/apk-vm/clipboard` | Read the device clipboard (`GET`, scrcpy `GET_CLIPBOARD`) or write text (`POST {"text":…}`). Explicit calls only; no background clipboard sync. |
|
|
610
|
+
| GET/POST | `/apk-vm/snapshots` | List named AVD snapshots; `POST {"action":"save\|load\|delete","name":…}`. |
|
|
611
|
+
| POST | `/apk-vm/ui-test` | `{"name":…,"assertions":[…],"updateBaseline":false}` — UIAutomator assertions + exact-byte screenshot baseline; returns JSON and Markdown. |
|
|
612
|
+
| POST | `/apk-vm/network/har` | `{"path":"…har","method"?,"status"?,"domain"?,"search"?}` — load an external proxy HAR, summarize/filter and include bounded entries + curl. |
|
|
609
613
|
| POST | `/apk-vm/stream` | `{"fps":1–10}` — set the PNG fallback target frame rate. |
|
|
614
|
+
| POST | `/apk-vm/stream/quality` | `{"preset":"low\|balanced\|high"}` — change H.264 resolution/bitrate/fps; the scrcpy session reconnects. |
|
|
610
615
|
| GET (upgrade) | `/apk-vm/ws` | WebSocket H.264 stream (see above). |
|
|
611
616
|
| GET | `/apk-vm/instances` | List default + extra VM instances, including `owner`, `lastUsedAt`, `idleMs`, `idleTimeoutMs`, `videoClients`. |
|
|
612
617
|
| POST | `/apk-vm/instances` | `{"name":"agent-a","start":true}` — create an isolated AVD/VM; every extra instance has its own H.264 stream. |
|