dsh-adb 0.1.3 → 0.1.4
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 +27 -1
- package/lib/tools/perf.js +5 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -80,9 +80,35 @@ headless profile 端到端验证(`dsh --profile bench "任务"`),**7 个
|
|
|
80
80
|
|
|
81
81
|
配置覆盖(`adbPath`/`defaultSerial`)✅ · 错误码(`ADB_NOT_FOUND`/`CONNECT_FAILED`)✅
|
|
82
82
|
|
|
83
|
-
>
|
|
83
|
+
> 冒烟发现并修复三个已发布 bug:
|
|
84
84
|
> - **v0.1.0 → v0.1.1**:`ctx.tools.register` 未声明 `inject: ['tools']` 导致加载失败(Cordis Guard 拒绝未声明依赖)
|
|
85
85
|
> - **v0.1.1 → v0.1.2**:后台 logcat 的 `readOutput` 返回 `{added,text}` 对象,违反 jobs 契约(须返回字符串)导致 `job_output` 报 `value.text must be a string`
|
|
86
|
+
> - **v0.1.2 → v0.1.3**:`DEVICE_NOT_FOUND` 分类只匹配带 `error:` 前缀的 adb 输出,真实输出 `adb.exe: device 'X' not found` 落入通用 `ADB_EXIT_1`
|
|
87
|
+
|
|
88
|
+
## 测试覆盖率矩阵(v0.1.3)
|
|
89
|
+
|
|
90
|
+
| 功能 | 单元测试 | 端到端实测(台架) |
|
|
91
|
+
| --- | --- | --- |
|
|
92
|
+
| `adb_devices` | ✅ 解析器 | ✅ |
|
|
93
|
+
| `adb_connect`(失败路径) | ✅ 分类器 | ✅ CONNECT_FAILED |
|
|
94
|
+
| `adb_connect`(成功路径) | - | ⚠️ 环境受限(台架无线不可达),需车内/可路由网络 |
|
|
95
|
+
| `adb_disconnect` | - | ✅ |
|
|
96
|
+
| `adb_logcat` 前向(level/tail) | ✅ 解析器+过滤 | ✅ |
|
|
97
|
+
| `adb_logcat` tag/keyword 过滤 | ✅ 过滤助手 | ✅(tag+keyword 均正向命中) |
|
|
98
|
+
| `adb_logcat` since/until | ⚠️ 仅逻辑(时间串字典序) | 未单独 E2E(同过滤链) |
|
|
99
|
+
| `adb_logcat` 后台采集 | - | ✅ job_output 读回 43065 行/7MB,job_kill 正常 |
|
|
100
|
+
| `adb_install` 成功 | - | ✅ install -r Success |
|
|
101
|
+
| `adb_install` 失败(LOCAL_FILE_NOT_FOUND/INSTALL_FAILED) | ✅ 分类器 | ✅ 伪 apk → INSTALL_PARSE_FAILED_NOT_APK |
|
|
102
|
+
| `adb_file` ls / ls -lR | - | ✅ |
|
|
103
|
+
| `adb_file` push/pull 往返 | - | ✅ 字节一致 |
|
|
104
|
+
| `adb_file` rm | - | ✅ 删除生效 |
|
|
105
|
+
| `adb_perf_snapshot` meminfo | ✅ 解析器 | ✅ SystemUI PSS/RSS/Heap |
|
|
106
|
+
| `adb_perf_snapshot` gfxinfo | ✅ 解析器 | ✅ 帧率/卡顿/百分位 |
|
|
107
|
+
| `adb_perf_snapshot` battery | ✅ 解析器 | ⚠️ 台架无电池服务返回空(行为正确) |
|
|
108
|
+
| 配置 adbPath/defaultSerial | - | ✅ 覆盖生效 |
|
|
109
|
+
| 错误码 ADB_NOT_FOUND/DEVICE_NOT_FOUND/NO_DEVICES/CONNECT_FAILED/INSTALL_FAILED | ✅ 分类器 | ✅ 实测/确定性验证 |
|
|
110
|
+
|
|
111
|
+
**原则:提交即测。** 未能在本台架覆盖的路径(正向无线连接、battery 实数据)已明确标注,不视为「已测通过」。
|
|
86
112
|
|
|
87
113
|
## License
|
|
88
114
|
|
package/lib/tools/perf.js
CHANGED
|
@@ -24,7 +24,11 @@ export function registerPerfTool(ctx, cfg) {
|
|
|
24
24
|
const metrics = args.metrics ?? ['meminfo', 'gfxinfo', 'battery'];
|
|
25
25
|
const result = { package: args.package, metrics: [...metrics] };
|
|
26
26
|
for (const metric of metrics) {
|
|
27
|
-
|
|
27
|
+
// dumpsys battery is device-global and takes no package argument.
|
|
28
|
+
const argv = metric === 'battery'
|
|
29
|
+
? ['shell', 'dumpsys', 'battery']
|
|
30
|
+
: ['shell', 'dumpsys', metric, args.package];
|
|
31
|
+
const output = await runAdb(ctx, cfg, argv, {
|
|
28
32
|
signal: exec.signal,
|
|
29
33
|
serial: args.serial,
|
|
30
34
|
maxBytes: 4 * 1024 * 1024,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-adb",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "ADB device & bench operations for DeepSeek Harness: device discovery, structured logcat, apk install, file pull/push, performance snapshots",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|