@deveco-test/hmos-deveco-cli 0.3.0-TD.1.1 → 0.3.0-TD.1.2

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
@@ -380,7 +380,7 @@ devecocli device view -t "My Device Name"
380
380
  **命令格式:**
381
381
 
382
382
  ```bash
383
- devecocli run --module <module> --device <device> --product <product> --build-mode <mode> --ability <ability> --uninstall --skip-build
383
+ devecocli run --module <module> --device <device> --product <product> --build-mode <mode> --ability <ability> --uninstall --skip-build --apply <txtFile>
384
384
  ```
385
385
 
386
386
  **参数:**
@@ -394,6 +394,7 @@ devecocli run --module <module> --device <device> --product <product> --build-mo
394
394
  | --ability | 可选,待启动的 `Ability` ,默认:模块 `module.json5` 中的`mainElement` |
395
395
  | --uninstall | 可选,安装前先卸载已有应用 |
396
396
  | --skip-build | 可选,跳过构建操作,直接安装应用 。\*\*说明:\*\*使用该参数时,需确保对应模块已有构建产物 |
397
+ | --apply \<fileName\> | 可选,**快速增量部署**:仅重编改动文件 → signed hqf → `bm quickfix -a -f -o` 安装 → 重启,比全量 `run` 快。`<fileName>` 是工程 `.hvigor/` 目录下的**纯文件名**(调用方把清单写到此目录,文件名做安全校验防穿越);内容为本轮改动的源文件路径清单(每行一个相对工程根路径;`#`/空行忽略;`.ets`/`.ts`/`.cpp`/资源文件;changeFileList 增量累积,只需列本轮改的,历史文件自动保留)。模块从清单路径自动识别(无需 `--module`)。**前提**:先 `devecocli run` 全量构建部署一次(生成 buildConfig.json 缓存);**没生效排查**:检查 `<module>/build/config/buildConfig.json` 有无内容(空/无 = 没跑过 `devecocli run`);**失败兜底**:直接 `devecocli run` |
397
398
 
398
399
  **示例:**
399
400
 
@@ -404,6 +405,7 @@ devecocli run --module library@phone --device 127.0.0.1:5555
404
405
  devecocli run --product oversea --module entry --ability EntryAbility
405
406
  devecocli run --build-mode release
406
407
  devecocli run --uninstall
408
+ devecocli run --apply changes.txt
407
409
  ```
408
410
 
409
411
  ### `log`
package/SKILL.md CHANGED
@@ -59,6 +59,11 @@ Build, install, and launch.
59
59
  - `--ability <ability>`: Default from `module.json5`.
60
60
  - `--uninstall`: Uninstall existing app first (Fixes signing key issues).
61
61
  - `--skip-build`: Deploy existing artifacts.
62
+ - `--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).
63
+ - `<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.
64
+ - **Prereq**: run `devecocli run` once first (full build + deploy + generates the `buildConfig.json` cache that `--apply` reuses).
65
+ - **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`.
66
+ *Ex*: `devecocli run` → edit code → write `.hvigor/changes.txt` → `devecocli run --apply changes.txt`
62
67
  - **Previewer mode** (auto-detected from `--device`): When `--device` value matches previewer product names (e.g. `"Pura 90 Pro"`, `"MatePad 11.5'S"`, `phone`, `pad`), the CLI launches the DevEco Studio **previewer** instead of installing/running the app. Comma-separated names → multi-previewer (count = list length). When `--device` is a serial/IP:port/unmatched value, normal run mode is used. Omitting `--device` → normal run. Ensures the DevEco Studio desktop process is running first (throws immediately if not — does NOT auto-start Studio on any platform), then `hdc shell aa start -a DevEcoViewerAbility -b com.huawei.devecostudio -m DevEcoViewer --pi instanceId <pid> --ps paramJson <JSON with double-quotes escaped>` with project info (`bundleName` / `abilityName` / `moduleName` / `productName` / `productType` / `subProductType` / `instanceId` / `launchDeviceIndex` / `launchFlag` / `isCustom` / `nativeDebuggable` / `appDebuggable`). `instanceId` = CLI process.pid; `launchDeviceIndex` = -1 for single previewer, 0-based for multi. Skips build/install (except multi-previewer needs build+install with multiAppMode). **Smart matching**: case/whitespace/punctuation insensitive; accepts aliases (`phone`, `tablet`/`pad`, `fold`/`foldable`, `widefold`/`wide`, `triplefold`/`triple`) and short forms; substring match and Levenshtein ≤ 2 fallback. Ambiguous matches report candidates. Supported products: `Pura 90 Pro`, `MatePad 11.5'S`, `Mate X7`, `Pura X`, `Mate XT`.
63
68
  - **Windows/macOS**: uses DevEco Studio's bundled hdc, auto-detects Studio install path via ToolProvider. hdc target device is auto-selected via `selectDevice` (previewer mode does not use `--device` as hdc target).
64
69
  - **HarmonyOS native (2in1 PC)**: hdc does NOT auto-discover the local device — self-connect required. In previewer mode, `--device` is the product name (not hdc target). The CLI checks `hdc list targets` for a `127.0.0.1:<port>` entry: if found, uses it directly; if not found, warns `hdc 未自联` and fallbacks to `connectLocalDevice` (resolution: `DEVECO_HDC_PORT` env var → existing `hdc list targets` → interactive prompt → error). DevEco Studio is a system app there; local `pgrep` cannot see Studio's process due to UID isolation, so the CLI detects Studio via `hdc shell ps -ef | grep com.huawei.devecostudio` (hdcd runs as root) — requires hdc self-connect first. The CLI does NOT auto-start Studio on any platform.
@@ -73,6 +78,31 @@ Fetch hilog or crash logs. Req `--device <name|serial>` on multi-device hosts.
73
78
  - `--tail <num>` / `--follow`: Keep last N lines / stream real-time (no `--to`).
74
79
  *Ex*: `devecocli log --crash --bundle-name com.example.app`, `devecocli log --level E --from 5m --tail 200`
75
80
 
81
+ ### `devecocli ui`
82
+ Inspect UI on a connected device. All subcommands accept `--device <name|serial>` (Req on multi-device hosts).
83
+
84
+ | Subcommand | Description | Key Options |
85
+ |---|---|---|
86
+ | `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` |
87
+ | `window list` | List active windows | `--format default\|json`, `--all` (include system windows) |
88
+ | `screenshot` | Capture a screenshot of the device screen | `--display <displayId>`, required `--path <path>` (existing directory or PNG file path; relative paths supported; writable destination; no overwrite) |
89
+ | `click [x] [y]` | Tap at the specified coordinates or node | `--id <id>` (auto-resolves to center), `--window <windowId>` (used with `--id`) |
90
+ | `doubleclick [x] [y]` | Double-tap at the specified coordinates or node | `--id <id>`, `--window <windowId>` |
91
+ | `longclick [x] [y]` | Long-press at the specified coordinates or node | `--id <id>`, `--window <windowId>` |
92
+ | `swipe <x1> <y1> <x2> <y2>` | Swipe from one point to another (precise coordinates, custom speed) | `--speed <n>` (200–40000, px/s) |
93
+ | `fling <x1> <y1> <x2> <y2>` | Fling from one point to another | `--speed <n>` (200–40000, px/s) |
94
+ | `drag <x1> <y1> <x2> <y2>` | Drag from one point to another | `--speed <n>` (200–40000, px/s) |
95
+ | `dircfling <direction>` | Quick directional fling (system default speed, ideal for scrolling) | `direction`: `up`, `down`, `left`, `right` |
96
+ | `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`) |
97
+
98
+ - **Coordinates vs `--id`**: Mutually exclusive. Provide either `x y` or `--id <id>`. For `text`, if neither is given, text goes to the currently focused field.
99
+ - **`--window`**: May only be used together with `--id`. Default is focused window. Secondary display operations via `--id` + `--window` are not supported.
100
+ - **`swipe` vs `dircfling`**: `swipe` requires exact start/end coordinates and supports `--speed`; `dircfling` only needs a direction (`up/down/left/right`) and uses system default speed (ideal for page/list scrolling).
101
+ - **Text encoding**: Special characters in `text` are Base64-encoded internally to safely pass through device shell.
102
+ - `--format json` pairs well with `jq`.
103
+ - `--mode full`: full layout tree, no filtering.
104
+ - `--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.
105
+
76
106
  ## 2. Setup
77
107
 
78
108
  ### `devecocli init`
@@ -1107,6 +1107,39 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1107
1107
 
1108
1108
  -----------
1109
1109
 
1110
+ The following npm package may be included in this product:
1111
+
1112
+ - @socket.io/component-emitter@3.1.2
1113
+
1114
+ This package contains the following license:
1115
+
1116
+ (The MIT License)
1117
+
1118
+ Copyright (c) 2014 Component contributors <dev@component.io>
1119
+
1120
+ Permission is hereby granted, free of charge, to any person
1121
+ obtaining a copy of this software and associated documentation
1122
+ files (the "Software"), to deal in the Software without
1123
+ restriction, including without limitation the rights to use,
1124
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
1125
+ copies of the Software, and to permit persons to whom the
1126
+ Software is furnished to do so, subject to the following
1127
+ conditions:
1128
+
1129
+ The above copyright notice and this permission notice shall be
1130
+ included in all copies or substantial portions of the Software.
1131
+
1132
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
1133
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
1134
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
1135
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
1136
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
1137
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
1138
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
1139
+ OTHER DEALINGS IN THE SOFTWARE.
1140
+
1141
+ -----------
1142
+
1110
1143
  The following npm packages may be included in this product:
1111
1144
 
1112
1145
  - body-parser@2.2.2
@@ -1427,6 +1460,97 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1427
1460
 
1428
1461
  -----------
1429
1462
 
1463
+ The following npm package may be included in this product:
1464
+
1465
+ - engine.io-parser@5.2.3
1466
+
1467
+ This package contains the following license:
1468
+
1469
+ (The MIT License)
1470
+
1471
+ Copyright (c) 2014-present Guillermo Rauch and Socket.IO contributors
1472
+
1473
+ Permission is hereby granted, free of charge, to any person obtaining
1474
+ a copy of this software and associated documentation files (the
1475
+ 'Software'), to deal in the Software without restriction, including
1476
+ without limitation the rights to use, copy, modify, merge, publish,
1477
+ distribute, sublicense, and/or sell copies of the Software, and to
1478
+ permit persons to whom the Software is furnished to do so, subject to
1479
+ the following conditions:
1480
+
1481
+ The above copyright notice and this permission notice shall be
1482
+ included in all copies or substantial portions of the Software.
1483
+
1484
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
1485
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1486
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1487
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
1488
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1489
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1490
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1491
+
1492
+ -----------
1493
+
1494
+ The following npm package may be included in this product:
1495
+
1496
+ - engine.io-client@6.6.6
1497
+
1498
+ This package contains the following license:
1499
+
1500
+ (The MIT License)
1501
+
1502
+ Copyright (c) 2014-present Guillermo Rauch and Socket.IO contributors
1503
+
1504
+ Permission is hereby granted, free of charge, to any person obtaining
1505
+ a copy of this software and associated documentation files (the
1506
+ 'Software'), to deal in the Software without restriction, including
1507
+ without limitation the rights to use, copy, modify, merge, publish,
1508
+ distribute, sublicense, and/or sell copies of the Software, and to
1509
+ permit persons to whom the Software is furnished to do so, subject to
1510
+ the following conditions:
1511
+
1512
+ The above copyright notice and this permission notice shall be
1513
+ included in all copies or substantial portions of the Software.
1514
+
1515
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
1516
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
1517
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
1518
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
1519
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
1520
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
1521
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1522
+
1523
+ -----------
1524
+
1525
+ The following npm package may be included in this product:
1526
+
1527
+ - socket.io-parser@4.2.6
1528
+
1529
+ This package contains the following license:
1530
+
1531
+ (The MIT License)
1532
+
1533
+ Copyright (c) 2014-present Guillermo Rauch and Socket.IO contributors
1534
+
1535
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
1536
+ this software and associated documentation files (the 'Software'), to deal in
1537
+ the Software without restriction, including without limitation the rights to
1538
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
1539
+ the Software, and to permit persons to whom the Software is furnished to do so,
1540
+ subject to the following conditions:
1541
+
1542
+ The above copyright notice and this permission notice shall be included in all
1543
+ copies or substantial portions of the Software.
1544
+
1545
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1546
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
1547
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
1548
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
1549
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
1550
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1551
+
1552
+ -----------
1553
+
1430
1554
  The following npm packages may be included in this product:
1431
1555
 
1432
1556
  - content-type@1.0.5
@@ -2244,6 +2368,35 @@ THE SOFTWARE.
2244
2368
 
2245
2369
  -----------
2246
2370
 
2371
+ The following npm package may be included in this product:
2372
+
2373
+ - ws@8.21.1
2374
+
2375
+ This package contains the following license:
2376
+
2377
+ Copyright (c) 2011 Einar Otto Stangvik <einaros@gmail.com>
2378
+ Copyright (c) 2013 Arnout Kazemier and contributors
2379
+ Copyright (c) 2016 Luigi Pinca and contributors
2380
+
2381
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
2382
+ this software and associated documentation files (the "Software"), to deal in
2383
+ the Software without restriction, including without limitation the rights to
2384
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
2385
+ the Software, and to permit persons to whom the Software is furnished to do so,
2386
+ subject to the following conditions:
2387
+
2388
+ The above copyright notice and this permission notice shall be included in all
2389
+ copies or substantial portions of the Software.
2390
+
2391
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2392
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
2393
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
2394
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
2395
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
2396
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2397
+
2398
+ -----------
2399
+
2247
2400
  The following npm package may be included in this product:
2248
2401
 
2249
2402
  - ipaddr.js@1.9.1
@@ -2800,6 +2953,16 @@ IN THE SOFTWARE.
2800
2953
 
2801
2954
  -----------
2802
2955
 
2956
+ The following npm package may be included in this product:
2957
+
2958
+ - xmlhttprequest-ssl@2.1.2
2959
+
2960
+ This package contains the following license:
2961
+
2962
+ http://creativecommons.org/licenses/MIT/
2963
+
2964
+ -----------
2965
+
2803
2966
  The following npm package may be included in this product:
2804
2967
 
2805
2968
  - zod-to-json-schema@3.25.2
@@ -4065,7 +4228,7 @@ The following npm packages may be included in this product:
4065
4228
  - ini@1.3.8
4066
4229
  - isexe@2.0.0
4067
4230
  - once@1.4.0
4068
- - semver@7.7.4
4231
+ - semver@7.8.5
4069
4232
  - which@2.0.2
4070
4233
  - wrappy@1.0.2
4071
4234
 
@@ -4518,6 +4681,36 @@ SOFTWARE.
4518
4681
 
4519
4682
  -----------
4520
4683
 
4684
+ The following npm package may be included in this product:
4685
+
4686
+ - socket.io-client@4.8.3
4687
+
4688
+ This package contains the following license:
4689
+
4690
+ The MIT License (MIT)
4691
+
4692
+ Copyright (c) 2014-present Guillermo Rauch and Socket.IO contributors
4693
+
4694
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4695
+ of this software and associated documentation files (the "Software"), to deal
4696
+ in the Software without restriction, including without limitation the rights
4697
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
4698
+ copies of the Software, and to permit persons to whom the Software is
4699
+ furnished to do so, subject to the following conditions:
4700
+
4701
+ The above copyright notice and this permission notice shall be included in
4702
+ all copies or substantial portions of the Software.
4703
+
4704
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
4705
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
4706
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
4707
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
4708
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
4709
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
4710
+ THE SOFTWARE.
4711
+
4712
+ -----------
4713
+
4521
4714
  The following npm package may be included in this product:
4522
4715
 
4523
4716
  - define-properties@1.2.1