@deveco-test/deveco-cli 1.3.0-Test.4 → 1.3.0-Test.6

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 CHANGED
@@ -324,7 +324,7 @@ devecocli emulator list
324
324
 
325
325
  ### `emulator start`
326
326
 
327
- 启动模拟器。首次使用时,需要签署 HarmonyOS 软件许可与服务协议,具体请参考 `emulator license accept`
327
+ 启动模拟器。首次使用时,需要签署 HarmonyOS 软件许可与服务协议,具体请参考 `emulator license`
328
328
 
329
329
  **命令格式:**
330
330
 
@@ -512,7 +512,7 @@ devecocli emulator image list --format json
512
512
 
513
513
  ### `emulator image download`
514
514
 
515
- 下载模拟器镜像。首次使用时,需要签署 HarmonyOS `SDK` 许可协议,具体请参考 `emulator license accept`
515
+ 下载模拟器镜像。首次使用时,需要签署 HarmonyOS `SDK` 许可协议,具体请参考 `emulator license`
516
516
 
517
517
  **命令格式:**
518
518
 
@@ -571,9 +571,19 @@ devecocli emulator image remove --device-type phone --os-version "HarmonyOS 6.0.
571
571
  devecocli emulator license view
572
572
  ```
573
573
 
574
+ ### `emulator license`
575
+
576
+ 交互式查看并接受协议。打印完整协议文本后提示 y/N 确认。使用模拟器需要同意 HarmonyOS 软件许可与服务协议,下载镜像需要同意 HarmonyOS `SDK` 许可协议。若已同意则直接提示已接受。非交互终端下会报错,请改用 `emulator license accept`
577
+
578
+ **命令格式:**
579
+
580
+ ```bash
581
+ devecocli emulator license
582
+ ```
583
+
574
584
  ### `emulator license accept`
575
585
 
576
- 查看并接受协议。使用模拟器需要同意 HarmonyOS 软件许可与服务协议,下载镜像需要同意 HarmonyOS `SDK` 许可协议
586
+ 非交互式同意模拟器所有协议,直接写入同意记录,跳过协议展示和确认提示。适用于自动化脚本、CI 或非交互终端环境。若已同意则直接提示已接受
577
587
 
578
588
  **命令格式:**
579
589
 
@@ -622,20 +632,21 @@ devecocli device view -t "My Device Name"
622
632
  **命令格式:**
623
633
 
624
634
  ```bash
625
- devecocli run --module <module> --device <device> --product <product> --build-mode <mode> --ability <ability> --uninstall --skip-build
635
+ devecocli run --module <module> --device <device> --product <product> --build-mode <mode> --ability <ability> --uninstall --skip-build --apply <txtFile>
626
636
  ```
627
637
 
628
638
  **参数:**
629
639
 
630
- | 参数名 | 说明 |
631
- | ------------ | ------------------------------------------------------------------------------------------------------ |
632
- | --module | 可选,模块名称。如需指定模块的 `target` 信息,使用 `module@target` 形式。当工程中只有一个可运行模块( `entry` / `feature` / `shared` )时,可缺省 |
633
- | --device | 设备名称或设备序列号,单设备时可选,多设备时必选 |
634
- | --product | 可选,产品的名称,默认为 `default` |
635
- | --build-mode | 可选,构建模式名称,默认为 `debug` |
636
- | --ability | 可选,待启动的 `Ability` ,默认:模块 `module.json5` 中的`mainElement` |
637
- | --uninstall | 可选,安装前先卸载已有应用 |
638
- | --skip-build | 可选,跳过构建操作,直接安装应用 。\*\*说明:\*\*使用该参数时,需确保对应模块已有构建产物 |
640
+ | 参数名 | 说明 |
641
+ | ------------ |--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
642
+ | --module | 可选,模块名称。如需指定模块的 `target` 信息,使用 `module@target` 形式。当工程中只有一个可运行模块( `entry` / `feature` / `shared` )时,可缺省 |
643
+ | --device | 设备名称或设备序列号,单设备时可选,多设备时必选 |
644
+ | --product | 可选,产品的名称,默认为 `default` |
645
+ | --build-mode | 可选,构建模式名称,默认为 `debug` |
646
+ | --ability | 可选,待启动的 `Ability` ,默认:模块 `module.json5` 中的`mainElement` |
647
+ | --uninstall | 可选,安装前先卸载已有应用 |
648
+ | --skip-build | 可选,跳过构建操作,直接安装应用 。\*\*说明:\*\*使用该参数时,需确保对应模块已有构建产物 |
649
+ | --apply \<fileName\> | 可选,**快速增量部署**:仅重编改动文件 → signed hqf → `bm quickfix -a -f -o` 安装 → 重启,比全量 `run` 快。`<fileName>` 是工程 `.hvigor/` 目录下的**纯文件名**(调用方把清单写到此目录,文件名做安全校验防穿越);内容为本轮改动的源文件路径清单(每行一个相对工程根路径;`#`/空行忽略;`.ets`/`.ts`/`.cpp`/资源文件;changeFileList 增量累积,只需列本轮改的,历史文件自动保留)。模块从清单路径自动识别(无需 `--module`)。**前提**:DevEco Studio ≥6.1.1(hvigor `assembleDevHqf` 支持,低于拒绝并提示升级);先 `devecocli run` 全量构建部署一次(生成 buildConfig.json 缓存);**没生效排查**:检查 `<module>/build/config/buildConfig.json` 有无内容(空/无 = 没跑过 `devecocli run`);**失败兜底**:直接 `devecocli run` |
639
650
 
640
651
  **示例:**
641
652
 
@@ -646,6 +657,7 @@ devecocli run --module library@phone --device 127.0.0.1:5555
646
657
  devecocli run --product oversea --module entry --ability EntryAbility
647
658
  devecocli run --build-mode release
648
659
  devecocli run --uninstall
660
+ devecocli run --apply changes.txt
649
661
  ```
650
662
 
651
663
  ### `log`
package/SKILL.md CHANGED
@@ -1,14 +1,14 @@
1
1
  ---
2
2
  name: deveco-cli
3
3
  description: >-
4
- **MUST** use 'devecocli' for HarmonyOS apps (scaffold, build, run, debug, devices, emulators, logs, docs, 鸿蒙开发文档, skills). **REQUIRED** and **MANDATORY** if workspace has build-profile.json5 or oh-package.json5, or user mentions HarmonyOS, 鸿蒙, DevEco, ArkTS, ArkUI, docs, 鸿蒙文档, 知识, 搜索, or skills.
4
+ **MUST** use 'devecocli' for HarmonyOS apps (scaffold, build, run, debug, devices, emulators, logs, docs, UI inspection, 鸿蒙开发文档, skills). **REQUIRED** and **MANDATORY** if workspace has build-profile.json5 or oh-package.json5, or user mentions HarmonyOS, 鸿蒙, DevEco, ArkTS, ArkUI, docs, 鸿蒙文档, 知识, 搜索, skills, UI, UI测试, 组件调试.
5
5
  ---
6
6
 
7
7
  # DevEco CLI
8
8
 
9
- `devecocli` wraps DevEco Studio's `hvigor`, `ohpm`, `hdc`, emulator toolchain, and HarmonyOS-skills installer. **Prefer `devecocli` over invoking underlying tools directly.**
9
+ `devecocli` wraps DevEco Studio's `hvigor`, `ohpm`, `hdc`, emulator toolchain, UI inspection, and HarmonyOS-skills installer. **Prefer `devecocli` over invoking underlying tools directly.**
10
10
 
11
- Available commands: `build`, `run`, `update`, `device`, `emulator`, `ui`, `skills`, `log`, `create`, `init`, `serve`, `docs`.
11
+ Available commands: `build`, `run`, `update`, `device`, `emulator`, `skills`, `log`, `create`, `init`, `serve`, `docs`, `ui`.
12
12
 
13
13
  **Sandbox Rule**: Commands tagged `[Outside sandbox]` must be run outside the sandbox.
14
14
 
@@ -49,13 +49,6 @@ Manage local emulator instances and system images.
49
49
  - `image download` / `image remove` (Req: `--device-type`, `--os-version`): Download/remove image. (Takes 30+ min, set long timeout).
50
50
  *Device types*: `phone`, `foldable`, `widefold`, `triplefold`, `tablet`, `2in1`, `2in1 foldable`, `wearable`, `tv`.
51
51
 
52
- ### `devecocli ui`
53
- Inspect UI on a connected physical device or running emulator.
54
- - `screenshot`: Capture a screenshot from a physical device or running emulator. `--device <name|serial>` is optional when exactly one device is connected, and required when multiple devices are connected.
55
- - Optional: `--display <displayId>`, `--path <path>` (existing directory or PNG file path whose parent exists; create the directory first; default: `./screenshot-<timestamp>.png`).
56
- - Implementation uses `hdc shell snapshot_display` and `hdc file recv`; set `DEVECO_CLI_DEBUG=1` to inspect the actual `hdc` commands.
57
- *Ex*: `mkdir -p screenshots && devecocli ui screenshot --device Phone --path ./screenshots/phone.png`
58
-
59
52
  ### `devecocli docs`
60
53
  Search/read local HarmonyOS docs.
61
54
  - `search <keywords...>`: Match any keyword. Opts: `--catalog <name>`, `--format <default|json>`, `--limit <n>`.
@@ -74,6 +67,11 @@ Build, install, and launch.
74
67
  - `--ability <ability>`: Default from `module.json5`.
75
68
  - `--uninstall`: Uninstall existing app first (Fixes signing key issues).
76
69
  - `--skip-build`: Deploy existing artifacts.
70
+ - `--apply <fileName>`: **Fast incremental deploy** — rebuilds only changed files into a signed hqf, installs via `bm quickfix -a -f -o`, then restarts the app. Much faster than a full `devecocli run` for iterating on code changes. Modules are auto-detected from the file paths in `<fileName>` (no `--module` needed).
71
+ - `<fileName>`: a plain file name (no path separators) under the project's `.hvigor/` directory; the caller writes the changed-file list there. File name is sanitized to prevent path traversal. Content: list of **source file paths changed this round** (one per line, relative to project root or absolute; `#` comments and blank lines ignored; typically `.ets`/`.ts`/`.cpp`/resource files). The changeFileList is **incrementally merged** — only list files changed since the last apply; previously listed files are retained automatically.
72
+ - **Prereq**: DevEco Studio ≥6.1.1 (hvigor `assembleDevHqf` support; below is rejected with an upgrade hint); run `devecocli run` once first (full build + deploy + generates the `buildConfig.json` cache that `--apply` reuses).
73
+ - **If changes don't take effect**: check `<module>/build/config/buildConfig.json` has content — empty/missing means `devecocli run` wasn't run; on any apply failure, fall back to a full `devecocli run`.
74
+ *Ex*: `devecocli run` → edit code → write `.hvigor/changes.txt` → `devecocli run --apply changes.txt`
77
75
 
78
76
  ### `devecocli log`
79
77
  Fetch hilog or crash logs. Req `--device <name|serial>` on multi-device hosts.
@@ -84,6 +82,31 @@ Fetch hilog or crash logs. Req `--device <name|serial>` on multi-device hosts.
84
82
  - `--tail <num>` / `--follow`: Keep last N lines / stream real-time (no `--to`).
85
83
  *Ex*: `devecocli log --crash --bundle-name com.example.app`, `devecocli log --level E --from 5m --tail 200`
86
84
 
85
+ ### `devecocli ui`
86
+ Inspect UI on a connected device. All subcommands accept `--device <name|serial>` (Req on multi-device hosts).
87
+
88
+ | Subcommand | Description | Key Options |
89
+ |---|---|---|
90
+ | `layout` | Dump ArkUI accessibility layout tree — **visible area only** (on-screen nodes) | `--id <id>`, `--window <windowId>`, `--all-windows`, `--depth <n>` (0=unlimited, 1=root only, 2=root+children), `--format default\|json`, `--mode full\|simplified` |
91
+ | `window list` | List active windows | `--format table\|json`, `--all` (include system windows) |
92
+ | `screenshot` | Capture a screenshot of the device screen | `--display <displayId>`, `--path <path>` (existing directory or PNG file path whose parent exists; default: `./screenshot-<timestamp>.png`) |
93
+ | `click [x] [y]` | Tap at the specified coordinates or node | `--id <id>` (auto-resolves to center), `--window <windowId>` (used with `--id`) |
94
+ | `doubleclick [x] [y]` | Double-tap at the specified coordinates or node | `--id <id>`, `--window <windowId>` |
95
+ | `longclick [x] [y]` | Long-press at the specified coordinates or node | `--id <id>`, `--window <windowId>` |
96
+ | `swipe <x1> <y1> <x2> <y2>` | Swipe from one point to another | `--speed <n>` (200–40000, px/s) |
97
+ | `fling <x1> <y1> <x2> <y2>` | Fling from one point to another | `--speed <n>` (200–40000, px/s) |
98
+ | `drag <x1> <y1> <x2> <y2>` | Drag from one point to another | `--speed <n>` (200–40000, px/s) |
99
+ | `dircfling <direction>` | Fling in a fixed direction | `direction`: `up`, `down`, `left`, `right` |
100
+ | `text <text> [x] [y]` | Input text at a target location or the currently focused field | `--id <id>` (auto-resolves to center), `--window <windowId>` (used with `--id`) |
101
+
102
+ - Coordinates and `--id` are mutually exclusive. Provide either `x y` or `--id <id>`; for `text`, if neither is given the text goes to the currently focused field.
103
+ - `--window <windowId>` may only be used together with `--id`.
104
+ - Default: focused window only. Use `--window <id>` or `--all-windows` to target specific/all windows (mutually exclusive).
105
+ - `--format json` pairs well with `jq`.
106
+ - `--mode raw`: full layout tree, no filtering.
107
+ - `--mode simplified` (default): folds meaningless wrapper containers (non-root, no `id`, no text, not interactive) by lifting their surviving children up. `--depth` truncates after folding.
108
+
109
+
87
110
  ## 2. Setup
88
111
 
89
112
  ### `devecocli init`
@@ -124,7 +147,8 @@ Manage HarmonyOS skills in AI agents/projects.
124
147
  - **"No active devices" / "Multiple devices connected"**: Connect/start emulator. Pass `-t <serial>` (device view) or `--device <name|serial>` (run/log).
125
148
  - **`error:install sign info inconsistent`**: Signing key changed. Run `devecocli run --uninstall`.
126
149
  - **`skills add` agent not found**: Valid: `codebuddy`, `cursor`, `opencode`, `qoder`, `trae-cn`.
127
- - **`emulator start` / `image download` blocked on agreement**: User MUST run `devecocli emulator license accept` in interactive TTY. Agents cannot do this. Do not retry until accepted.
150
+ - **`emulator start` / `image download` blocked on agreement**: User MUST accept agreements. Interactive: `devecocli emulator license` (requires TTY). Non-interactive (CI/scripts): `devecocli emulator license accept`. Agents cannot run the interactive form; suggest the user run it, or use `license accept` if a non-TTY flow is acceptable. Do not retry until accepted.
128
151
  - **`image download` failure / timeout**: Do NOT auto-retry. Give the command to the user to run manually in their terminal.
129
152
  - **`emulator create` timeout**: Treat as user-action step. Ask user to open DevEco Studio -> Device Manager. Check `emulator list` after user confirms. Do NOT auto-retry or edit SDK files.
130
153
  - **`image list` duplicate OS rows**: `phone`/`foldable`/`widefold`/`triplefold` share the same image. Download/remove ONCE per OS version.
154
+ - **`ui layout` missing expected node**: `layout` only returns on-screen nodes. The user must scroll the target into view on the device before retrying (no CLI input subcommands in this build).
@@ -2343,7 +2343,7 @@ Felix Geisendörfer (felix@debuggable.com)
2343
2343
 
2344
2344
  The following npm package may be included in this product:
2345
2345
 
2346
- - form-data@4.0.5
2346
+ - form-data@4.0.6
2347
2347
 
2348
2348
  This package contains the following license:
2349
2349
 
@@ -2990,7 +2990,7 @@ SOFTWARE.
2990
2990
 
2991
2991
  The following npm package may be included in this product:
2992
2992
 
2993
- - napi-build-utils@2.0.0
2993
+ - napi-build-utils@1.0.2
2994
2994
 
2995
2995
  This package contains the following license:
2996
2996
 
@@ -3201,7 +3201,7 @@ SOFTWARE.
3201
3201
 
3202
3202
  The following npm package may be included in this product:
3203
3203
 
3204
- - hono@4.12.19
3204
+ - hono@4.12.30
3205
3205
 
3206
3206
  This package contains the following license:
3207
3207
 
@@ -3626,36 +3626,6 @@ SOFTWARE.
3626
3626
 
3627
3627
  -----------
3628
3628
 
3629
- The following npm package may be included in this product:
3630
-
3631
- - @deveco-test/deveco-cli@1.3.0-Test.4
3632
-
3633
- This package contains the following license:
3634
-
3635
- MIT License
3636
-
3637
- Copyright (c) 2026 Huawei Device Co., Ltd.
3638
-
3639
- Permission is hereby granted, free of charge, to any person obtaining a copy
3640
- of this software and associated documentation files (the "Software"), to deal
3641
- in the Software without restriction, including without limitation the rights
3642
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
3643
- copies of the Software, and to permit persons to whom the Software is
3644
- furnished to do so, subject to the following conditions:
3645
-
3646
- The above copyright notice and this permission notice shall be included in all
3647
- copies or substantial portions of the Software.
3648
-
3649
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
3650
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
3651
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3652
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
3653
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
3654
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
3655
- SOFTWARE.
3656
-
3657
- -----------
3658
-
3659
3629
  The following npm package may be included in this product:
3660
3630
 
3661
3631
  - merge-descriptors@2.0.0
@@ -3678,7 +3648,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI
3678
3648
 
3679
3649
  The following npm package may be included in this product:
3680
3650
 
3681
- - hasown@2.0.3
3651
+ - hasown@2.0.4
3682
3652
 
3683
3653
  This package contains the following license:
3684
3654
 
@@ -4515,7 +4485,7 @@ THE SOFTWARE.
4515
4485
 
4516
4486
  The following npm package may be included in this product:
4517
4487
 
4518
- - prebuild-install@7.1.3
4488
+ - prebuild-install@7.1.2
4519
4489
 
4520
4490
  This package contains the following license:
4521
4491