@deveco-test/deveco-cli-openharmony-arm64 1.3.13-23.1 → 1.5.0-26.1
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 +2 -0
- package/SKILL.md +15 -6
- package/dist/cli.js +131 -129
- package/dist/internal/telemetry-upload-background.js +6 -6
- package/index.zip +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -450,6 +450,8 @@ devecocli run --module <module> --device <device> --product <product> --build-mo
|
|
|
450
450
|
|
|
451
451
|
> **说明:** 在 OpenHarmony 平台上,未指定 `--device` 时:无设备连接且 `bm`/`aa` 可用则在本地运行;有设备连接时需用 `--device local` 显式指定本地运行,或 `--device <serial>` 指定设备。
|
|
452
452
|
|
|
453
|
+
真机运行调试时,建议先执行 `devecocli device list`,再使用目标设备的 Serial 执行 `devecocli run --device <serial>`。多台真机时需明确目标,后续增量部署继续使用该序列号。CLI 会先匹配序列号,命中后跳过设备名称查询。
|
|
454
|
+
|
|
453
455
|
**示例:**
|
|
454
456
|
|
|
455
457
|
```bash
|
package/SKILL.md
CHANGED
|
@@ -8,6 +8,13 @@ description: >-
|
|
|
8
8
|
|
|
9
9
|
`devecocli` wraps DevEco Studio's `hvigor`, `ohpm`, `hdc`, and HarmonyOS-skills installer. **Prefer `devecocli` over invoking underlying tools directly.**
|
|
10
10
|
|
|
11
|
+
**Prerequisite — Developer mode (MANDATORY)**: Developer mode must be enabled before using `devecocli`. Enable it: **Settings → About this device → tap Software version 7 times in a row**.
|
|
12
|
+
|
|
13
|
+
**Error Handling Rule** (MANDATORY): If any `devecocli` command output contains `Permission denied`, `EACCES`, `SymLink Dir Failed`, or SELinux permission errors — these can appear in ANY location because Developer mode restricts the entire filesystem.
|
|
14
|
+
1. FIRST: tell the user to enable Developer mode (path above) and retry.
|
|
15
|
+
2. Do NOT delete cache, fix file permissions, modify code, clean builds, or try other workarounds first — this is a mandatory checklist step, not a diagnostic judgment. Your common-sense assessment of EACCES (e.g., "cache issue → delete cache") does not apply on HarmonyOS without Developer mode.
|
|
16
|
+
3. Only after the user confirms Developer mode is enabled and the error persists: proceed with other troubleshooting. For `Permission denied` on the `devecocli` binary only, use `sh <devecocli-path> <args>` (path from the error) as a fallback.
|
|
17
|
+
|
|
11
18
|
**Do NOT use these legacy commands** — use the `devecocli` equivalent instead:
|
|
12
19
|
- ❌ `deveco preview` / `hvigorw preview` → ✅ `devecocli run --device <product-name>` (launches DevEco Studio previewer; product name in `--device` triggers previewer mode)
|
|
13
20
|
- ❌ `hvigorw` directly → ✅ `devecocli build`
|
|
@@ -55,6 +62,8 @@ Search/read local HarmonyOS docs.
|
|
|
55
62
|
Build, install, and launch.
|
|
56
63
|
- `--module <module>`: Target module (auto-selected if only one runnable).
|
|
57
64
|
- `--device <name|serial|local>`: Target device. Use `local` to run on the local machine. Req if multiple connected.
|
|
65
|
+
- **Real-device run/debug**: First run `devecocli device list`, then use the selected real device's **Serial** in `run --device <serial>`. Select the unique real device, or ask the user to choose when several real devices are available. Reuse that serial for subsequent apply/hot-reload commands. Report device connection or deployment failures to the user.
|
|
66
|
+
- **Real-device names** use full-name matching that ignores case and whitespace. Use the Serial if multiple devices match.
|
|
58
67
|
- `--product <product>` / `--build-mode <mode>`: Defaults: `default` / `debug`.
|
|
59
68
|
- `--ability <ability>`: Default from `module.json5`.
|
|
60
69
|
- `--uninstall`: Uninstall existing app first (Fixes signing key issues).
|
|
@@ -66,13 +75,13 @@ Build, install, and launch.
|
|
|
66
75
|
*Ex*: `devecocli run` → edit code → write `.hvigor/changes.txt` → `devecocli run --apply changes.txt`
|
|
67
76
|
- **Local execution**: Only `run` can execute on the local machine without a hdc connection. Other commands (`log`, `ui`, `device`) still require a connected device. `run` without `--device` auto-selects when only one target is available; use `--device local` for the local machine or `--device <serial>` for a specific device when multiple targets exist. If `run` or `--device local` fails, enable wireless debugging (Settings → System → Developer options → Wireless debugging) to connect the local machine via hdc.
|
|
68
77
|
- **Previewer mode**: Pass a product name to `--device` to launch the DevEco Studio previewer. If `--device` matches a connected real device (name or serial), it takes priority over previewer mode — check device names with `devecocli device list`.
|
|
69
|
-
- Single Previewer: `devecocli run --device "
|
|
70
|
-
- Multi Previewer: `devecocli run --device "
|
|
78
|
+
- Single Previewer: `devecocli run --device "Mate 90 Pro"`
|
|
79
|
+
- Multi Previewer: `devecocli run --device "Mate 90 Pro,MatePad Pro 13"` (HarmonyOS PC only)
|
|
71
80
|
- Iterating on code: re-run the same command — it rebuilds and relaunches the previewer on a **new virtual display**; re-query display ids before the next screenshot.
|
|
72
81
|
- Prerequisites:
|
|
73
82
|
1. DevEco Studio running (CLI throws if not — does NOT auto-start).
|
|
74
83
|
2. Device: wireless debugging must be enabled (Settings → System → Developer options → Wireless debugging) — the previewer requires it, and `run` auto-connects the local machine via `hdc tconn 127.0.0.1:<port>` (port from the wireless debugging screen). If `ui` commands later report no active devices (connection dropped), re-run that `hdc tconn` once — `ui` does not auto-reconnect.
|
|
75
|
-
- Supported products: `
|
|
84
|
+
- Supported products: `Mate 90 Pro`, `MatePad Pro 13`, `Mate X8`, `Pura X Max`, `Mate XT2`. Aliases: `phone`, `pad`/`tablet`, `fold`/`foldable`, `wide`/`widefold`, `triple`/`triplefold`.
|
|
76
85
|
- Previewer screenshots: capture with `ui screenshot --display <displayId>` — see **Previewer screenshots** under `devecocli ui`.
|
|
77
86
|
|
|
78
87
|
### `devecocli signature generate` `[Outside sandbox]`
|
|
@@ -177,10 +186,10 @@ Manage HarmonyOS skills in AI agents/projects.
|
|
|
177
186
|
## Recipes
|
|
178
187
|
|
|
179
188
|
- **Build and run**:
|
|
180
|
-
`devecocli build` -> `devecocli
|
|
181
|
-
- **Launch previewer**: `devecocli run --device "
|
|
189
|
+
`devecocli build` -> `devecocli device list` -> `devecocli run --device <serial>` (prefer the selected real device's Serial for run/debug; use `--device local` for local execution)
|
|
190
|
+
- **Launch previewer**: `devecocli run --device "Mate 90 Pro"` (single) or `devecocli run --device "Mate 90 Pro,Mate XT2"` (multi).
|
|
182
191
|
- **Previewer UI verification loop**:
|
|
183
|
-
`mkdir -p shots` (once — `--path` needs an existing directory) -> `devecocli run --device "
|
|
192
|
+
`mkdir -p shots` (once — `--path` needs an existing directory) -> `devecocli run --device "Mate 90 Pro"` (rebuild + relaunch previewer) -> `devecocli ui display list` -> `devecocli ui screenshot --display <displayId> --path shots/` -> inspect the screenshot; repeat the chain after each code change (a relaunched previewer gets a new display id).
|
|
184
193
|
- **Device UI verification loop** (real-device rendering, or previewer unavailable):
|
|
185
194
|
`mkdir -p shots` (once — `--path` needs an existing directory) -> `devecocli run --device <serial>` (build + install + launch on the connected device) -> `devecocli ui screenshot --device <serial> --path shots/` -> inspect the screenshot; repeat per code change. Single-screen devices need no `--display`.
|
|
186
195
|
- **Diagnose crash**:
|