@deveco-test/deveco-cli-openharmony-arm64 0.4.0-TD.3.6 → 0.4.0-TD.5.3
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 +10 -1
- package/SKILL.md +16 -17
- package/THIRD-PARTY-LICENSES +342 -233
- package/dist/cli.js +139 -140
- package/dist/internal/doc-init-background.js +9 -9
- package/dist/internal/telemetry-upload-background.js +1 -1
- package/index.zip +0 -0
- package/package.json +6 -4
- package/scripts/install-better-sqlite3.mjs +5 -1
- package/scripts/lib/better-sqlite3-vendor.mjs +19 -1
package/README.md
CHANGED
|
@@ -448,6 +448,8 @@ devecocli run --module <module> --device <device> --product <product> --build-mo
|
|
|
448
448
|
| --skip-build | 可选,跳过构建操作,直接安装应用 。\*\*说明:\*\*使用该参数时,需确保对应模块已有构建产物 |
|
|
449
449
|
| --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` |
|
|
450
450
|
|
|
451
|
+
> **说明:** 在 OpenHarmony 平台上,未指定 `--device` 时:无设备连接且 `bm`/`aa` 可用则在本地运行;有设备连接时需用 `--device local` 显式指定本地运行,或 `--device <serial>` 指定设备。
|
|
452
|
+
|
|
451
453
|
**示例:**
|
|
452
454
|
|
|
453
455
|
```bash
|
|
@@ -758,7 +760,7 @@ devecocli skills remove --skill skillname --agent agentname # skillname需替
|
|
|
758
760
|
**命令格式:**
|
|
759
761
|
|
|
760
762
|
```bash
|
|
761
|
-
devecocli signature generate --product <product> --team-id <team-id> --force --help
|
|
763
|
+
devecocli signature generate --product <product> --team-id <team-id> --udid <udid> --force --help
|
|
762
764
|
```
|
|
763
765
|
|
|
764
766
|
**参数:**
|
|
@@ -767,6 +769,7 @@ devecocli signature generate --product <product> --team-id <team-id> --force --
|
|
|
767
769
|
|-----------------------|-----------------------------------------|
|
|
768
770
|
| --product \<product\> | 可选,指定product生成签名,默认为 `default` |
|
|
769
771
|
| --team-id \<team-id\> | 可选,指定生效的team-id,默认使用自身作为团队信息 |
|
|
772
|
+
| --udid \<udid...\> | 可选,为未连接的设备签名。可重复传入或用逗号分隔多台;追加 `:<type>` 声明设备类型(`phone`\|`wearable`\|`liteWearable`\|`tv`,默认 `phone`)。与 `hdc` 自动探测到的设备合并,同一 UDID 以探测到的类型为准 |
|
|
770
773
|
| --force | 可选,强制覆盖已存在的证书文件 |
|
|
771
774
|
| --help,--h | 可选,查看帮助信息 |
|
|
772
775
|
|
|
@@ -782,6 +785,12 @@ devecocli signature generate --product default
|
|
|
782
785
|
# 指定team-id
|
|
783
786
|
devecocli signature generate --team-id 1222
|
|
784
787
|
|
|
788
|
+
# 为未连接的设备签名(UDID 为 64 位十六进制,可通过已连接设备的 `hdc shell bm get -u` 获取)
|
|
789
|
+
devecocli signature generate --udid 1A2B3C4D...
|
|
790
|
+
|
|
791
|
+
# 为未连接的穿戴设备签名,并同时传入多台
|
|
792
|
+
devecocli signature generate --udid 1A2B3C4D...:wearable --udid 5E6F7A8B...
|
|
793
|
+
|
|
785
794
|
# 强制覆盖已存在的证书文件
|
|
786
795
|
devecocli signature generate --force
|
|
787
796
|
|
package/SKILL.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
2
|
name: deveco-cli
|
|
3
3
|
description: >-
|
|
4
|
-
**MUST** use 'devecocli' for HarmonyOS apps (scaffold, build, run, debug,
|
|
4
|
+
**MUST** use 'devecocli' for HarmonyOS apps (scaffold, build, run, debug, device, logs, docs, 鸿蒙开发文档, skills, multi-preview). **REQUIRED** and **MANDATORY** if workspace has build-profile.json5 or oh-package.json5, or user mentions HarmonyOS, 鸿蒙, DevEco, ArkTS, ArkUI, docs, 鸿蒙文档, 知识, 搜索, skills, or preview/预览/预览器/多预览器/多设备预览器.
|
|
5
5
|
---
|
|
6
6
|
|
|
7
7
|
# DevEco CLI
|
|
@@ -15,11 +15,6 @@ description: >-
|
|
|
15
15
|
|
|
16
16
|
Available commands: `build`, `check`, `run`, `update`, `device`, `ui`, `skills`, `log`, `create`, `init`, `serve`, `docs`, `signature`, `auth`.
|
|
17
17
|
|
|
18
|
-
**Platform awareness**: On HarmonyOS native PC (2in1), **emulator commands are NOT available** and must never be suggested. The `emulator` command does not exist on this platform. When `device list` shows no devices, instead of suggesting emulator startup, tell the user to:
|
|
19
|
-
1. Enable wireless debugging in Settings → System → Developer options → Wireless debugging
|
|
20
|
-
2. Note the port number
|
|
21
|
-
3. Run `hdc tconn 127.0.0.1:<port>`
|
|
22
|
-
|
|
23
18
|
**Sandbox Rule**: Commands tagged `[Outside sandbox]` must be run outside the sandbox.
|
|
24
19
|
|
|
25
20
|
## 1. Code → Build → Deploy → Run → Debug
|
|
@@ -59,35 +54,38 @@ Search/read local HarmonyOS docs.
|
|
|
59
54
|
### `devecocli run` `[Outside sandbox]`
|
|
60
55
|
Build, install, and launch.
|
|
61
56
|
- `--module <module>`: Target module (auto-selected if only one runnable).
|
|
62
|
-
- `--device <name|serial>`: Target device
|
|
57
|
+
- `--device <name|serial|local>`: Target device. Use `local` to run on the local machine. Req if multiple connected.
|
|
63
58
|
- `--product <product>` / `--build-mode <mode>`: Defaults: `default` / `debug`.
|
|
64
59
|
- `--ability <ability>`: Default from `module.json5`.
|
|
65
60
|
- `--uninstall`: Uninstall existing app first (Fixes signing key issues).
|
|
66
61
|
- `--skip-build`: Deploy existing artifacts.
|
|
67
|
-
- `--apply <fileName>`: **Fast incremental deploy** — rebuilds only changed files into a signed hqf, installs via `bm quickfix
|
|
62
|
+
- `--apply <fileName>`: **Fast incremental deploy** — rebuilds only changed files into a signed hqf, installs via `bm quickfix`, 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).
|
|
68
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.
|
|
69
64
|
- **Prereq**: run `devecocli run` once first (full build + deploy + generates the `buildConfig.json` cache that `--apply` reuses).
|
|
70
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`.
|
|
71
66
|
*Ex*: `devecocli run` → edit code → write `.hvigor/changes.txt` → `devecocli run --apply changes.txt`
|
|
67
|
+
- **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.
|
|
72
68
|
- **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`.
|
|
73
69
|
- Single Previewer: `devecocli run --device "Pura 90 Pro"`
|
|
74
70
|
- Multi Previewer: `devecocli run --device "Pura 90 Pro,MatePad 11.5'S"`
|
|
75
71
|
- Prerequisites:
|
|
76
|
-
1.
|
|
77
|
-
2.
|
|
72
|
+
1. DevEco Studio running (CLI throws if not — does NOT auto-start).
|
|
73
|
+
2. Device: wireless debugging may be required (Settings → System → Developer options → Wireless debugging → `hdc tconn 127.0.0.1:<port>`).
|
|
78
74
|
- Supported products: `Pura 90 Pro`, `MatePad 11.5'S`, `Mate X7`, `Pura X`, `Mate XT`. Aliases: `phone`, `pad`/`tablet`, `fold`/`foldable`.
|
|
79
75
|
|
|
80
76
|
### `devecocli signature generate` `[Outside sandbox]`
|
|
81
77
|
Auto-generate HarmonyOS signing materials (local p12/csr + cloud cert + test profile) and write signing config to `build-profile.json5`.
|
|
82
|
-
- **Prereq**: `devecocli auth login` first; run from a project directory (with `build-profile.json5`)
|
|
78
|
+
- **Prereq**: `devecocli auth login` first; run from a project directory (with `build-profile.json5`). Devices are auto-detected via `hdc`; use `--udid` for devices that are not connected.
|
|
83
79
|
- `--product <name>`: Product name for local p12/csr file naming (default: `default`).
|
|
84
80
|
- `--team-id <id>`: Specify the team-id (default: current user's id).
|
|
85
81
|
- `--force`: Force regenerate even if existing materials are valid.
|
|
82
|
+
- `--udid <udid...>`: Register device UDID(s) that are not connected. Repeatable or comma-separated; append `:<type>` (`phone|wearable|liteWearable|tv`, default `phone`). Merged with auto-detected devices (a detected device's type wins), and skips the "no device" preflight failure. Any registration failure aborts before a profile is produced.
|
|
86
83
|
- Generates under `~/.ohos/config/`: `.p12` keystore, `.csr`, downloaded `.cer` certificate, `.p7b` profile.
|
|
87
84
|
- Writes `signingConfigs` + `products` entries to `build-profile.json5` with encrypted key/store passwords (AES-128-GCM).
|
|
88
85
|
- Cloud cert name: `auto_debug_<teamId>.cer`. Local files: `<product>_<project>_<hash>=.{p12,csr,cer,p7b}`.
|
|
86
|
+
- Prints the device list the profile covers, with each device's type and origin (`detected` / `manual`).
|
|
89
87
|
- Error handling: 401→re-login, 403→no AGC permission, `205389872`→cert limit, `205389904`→not Harmony user, `205389938`→provision limit, invalid `.cer`→retry.
|
|
90
|
-
*Ex*: `devecocli signature generate --product default`
|
|
88
|
+
*Ex*: `devecocli signature generate --product default`, `devecocli signature generate --udid <64-hex-udid>:wearable`
|
|
91
89
|
|
|
92
90
|
### `devecocli log`
|
|
93
91
|
Fetch hilog or crash logs. Req `--device <name|serial>` on multi-device hosts.
|
|
@@ -163,8 +161,8 @@ Manage HarmonyOS skills in AI agents/projects.
|
|
|
163
161
|
|
|
164
162
|
## Recipes
|
|
165
163
|
|
|
166
|
-
- **
|
|
167
|
-
`devecocli build` -> `devecocli
|
|
164
|
+
- **Build and run**:
|
|
165
|
+
`devecocli build` -> `devecocli run` (auto-selects when only one target; use `--device local` or `--device <serial>` when multiple targets exist)
|
|
168
166
|
- **Launch previewer**: `devecocli run --device "Pura 90 Pro"` (single) or `devecocli run --device "Pura 90 Pro,Mate XT"` (multi).
|
|
169
167
|
- **Diagnose crash**:
|
|
170
168
|
`devecocli log --crash --bundle-name <bundle>`
|
|
@@ -177,11 +175,12 @@ Manage HarmonyOS skills in AI agents/projects.
|
|
|
177
175
|
|
|
178
176
|
- **"Product / Build mode `<x>` not found"**: Check `build-profile.json5`.
|
|
179
177
|
- **"Multiple entry modules" / "No entry module"**: Pass `--modules` (build) or `--module` (run).
|
|
180
|
-
- **"No active devices" / "Multiple devices connected"**:
|
|
178
|
+
- **"No active devices" / "Multiple devices connected"**: Use `--device <serial>` to target a connected device, or `--device local` to run on the local machine.
|
|
181
179
|
- **`error:install sign info inconsistent`**: Signing key changed. Run `devecocli run --uninstall` or `devecocli signature generate --force`.
|
|
182
180
|
- **`Not logged in. Run devecocli auth login first`**: Run `devecocli auth login` to authenticate.
|
|
183
181
|
- **`Provision number exceeds limit`**: Test provision quota is full. Delete old test provisions in DevEco Studio (Signing Configs) or AGC console, then retry `devecocli signature generate`.
|
|
182
|
+
- **`Unable to create the profile file due to missing devices`**: No device is connected and the AGC cloud device list is empty. Connect a device, or sign for a device you don't have on hand via `devecocli signature generate --udid <64-hex-udid>`.
|
|
184
183
|
- **`Invalid AccessToken. Sign in and try again`**: Token expired. Run `devecocli auth login` again.
|
|
185
184
|
- **`skills add` agent not found**: Valid: `codebuddy`, `cursor`, `opencode`, `qoder`, `trae-cn`.
|
|
186
|
-
-
|
|
185
|
+
- **`hdc list targets` shows `[Empty]`**: `devecocli run` can run on the local machine without a connected device, or enable wireless debugging (Settings → System → Developer options → Wireless debugging) to connect the local machine via hdc.
|
|
187
186
|
- **Previewer — "DevEco Studio is not running"**: Tell the user to start DevEco Studio manually first, then retry. Do NOT retry automatically.
|