@oniroproject/oniro-app 0.14.0 → 0.16.0

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
@@ -61,9 +61,20 @@ Install commands are idempotent (they skip when already present); pass `--force`
61
61
  | Command | Description |
62
62
  | --- | --- |
63
63
  | `sdk install <version> [--force] [--tmp-dir <path>]` | Download and install an OpenHarmony SDK (e.g. `6.1`). `--tmp-dir` overrides where download/extract temporaries go (see [Temporary space](#temporary-space)). |
64
+ | `sdk install --from-archive <path> [--force] [--tmp-dir <path>]` | Install an SDK from a local `.tar.gz` instead, such as the [full SDK](#full-sdk). Only the current OS's components are unpacked, and the API level is read from them; an SDK already installed at that level is replaced only with `--force`. |
64
65
  | `sdk list [--json]` | List known SDK versions; an `*` marks installed ones. |
65
66
  | `sdk remove <api>` | Remove an installed SDK by API level (e.g. `18`, `20`). |
66
67
 
68
+ ##### Full SDK
69
+
70
+ `sdk install <version>` downloads the public SDK, which leaves out system APIs (`@systemapi`). The full SDK is not on the release mirror: download an `ohos-sdk-full` archive from the [OpenHarmony daily builds](https://dcp.openharmony.cn/workbench/cicd/dailybuild/dailylist) and install it from the file:
71
+
72
+ ```bash
73
+ oniro-app sdk install --from-archive ~/Downloads/version-Master_Version-OpenHarmony_7.0.0.39-…-ohos-sdk-full_7.0-Release.tar.gz
74
+ ```
75
+
76
+ It lands in `<ONIRO_SDK_ROOT_DIR>/<os>/<api>` like a downloaded release, so projects with that `compileSdkVersion` build against it. Pass `--force` to replace a public SDK of the same API level, or set `ONIRO_SDK_ROOT_DIR` to a separate root to keep both.
77
+
67
78
  #### `cmdtools` — manage the OpenHarmony command-line tools (provides `hvigorw`, `ohpm`, `hdc`, `codelinter`)
68
79
 
69
80
  | Command | Description |
@@ -221,6 +232,45 @@ Local paths may be relative, or absolute with either slash. A device path that a
221
232
  | `--domain <domain>` | hilog domain filter (e.g. `0xD003900`). |
222
233
  | `--device <serial>` | Target device serial. |
223
234
 
235
+ #### `logs collect` — create a diagnostic bundle
236
+
237
+ ```bash
238
+ oniro-app logs collect --redact --package com.example.app
239
+ ```
240
+
241
+ The command requires exactly one connected device unless `--device` (or
242
+ `ONIRO_DEVICE_SERIAL`) selects one. It captures the current `hilog -x` buffer,
243
+ faultlog evidence, device information, process list, and memory/thread snapshots.
244
+ Because `hilog -x` has no duration argument, `--duration` filters recognized
245
+ HiLog timestamps locally using device clock readings before and after the snapshot.
246
+ If the clock or log format cannot be parsed reliably, the manifest records the
247
+ window as unapplied, the command exits non-zero, and the full snapshot is omitted
248
+ from the redacted archive (it remains only in the local raw bundle).
249
+ `--pid`, `--tag`, and `--level` create an additional filtered HiLog view from the
250
+ time-bounded records when their format can be parsed reliably. `--package`
251
+ targets `hidumper -e --print <bundle> -n 5` for faultlog evidence.
252
+
253
+ `--redact` creates a sibling `incident-...-redacted` directory and ZIP; the
254
+ archive is built only from that redacted copy. Without `--redact`, the archive
255
+ contains raw sensitive data. Redaction is heuristic, fails closed on binary or
256
+ unknown-encoding files, and does not guarantee that a bundle is safe to publish.
257
+ Collection continues after individual command failures and records each result
258
+ in `manifest.json`; the CLI exits non-zero for a partial bundle. The default
259
+ output is under `~/.oniro/incident-bundles`; bundle files are created with
260
+ owner-only permissions where the host OS supports POSIX modes.
261
+
262
+ | Flag | Description |
263
+ | --- | --- |
264
+ | `-o, --output <directory>` | Parent directory for bundles (default `~/.oniro/incident-bundles`). |
265
+ | `--device <serial>` | Target device serial. |
266
+ | `--package <bundle>` | Bundle name for package-specific faultlog collection. |
267
+ | `--pid <pid>` | Create an exact-PID filtered HiLog view. |
268
+ | `--tag <tag>` | Create an exact-tag filtered HiLog view. |
269
+ | `--level <level>` | Create a filtered view for `V`, `D`, `I`, `W`, `E`, or `F`. |
270
+ | `--duration <seconds>` | Include HiLog records from the last N seconds (default `600`; maximum `31536000`). |
271
+ | `--redact` | Redact text evidence; create the archive only from the redacted copy. |
272
+ | `--json` | Emit bundle paths and completion status as JSON. |
273
+
224
274
  #### `hdc` — run the bundled hdc
225
275
 
226
276
  `hdc [args...]` runs the `hdc` binary oniro-app itself uses (the one `cmdtools status` shows), with stdio passed through, so it needs nothing on `PATH`. Device commands are addressed at `--device` or `ONIRO_DEVICE_SERIAL` unless the arguments start with `-t`. `hdc --path` prints the binary's location. The exit code is hdc's own, which is 0 even for a `[Fail]` line.
@@ -539,7 +589,7 @@ oniro-app sign --apl system_core --acls ohos.permission.ACCESSIBILITY_EXTENSION_
539
589
  --app-privilege-capabilities AllowAppUsePrivilegeExtension
540
590
  ```
541
591
 
542
- Apps like these usually also call system APIs (`@systemapi`), which the public SDK that `sdk install` downloads leaves out: the build fails with errors such as `'config' is not exported from Kit '@kit.AccessibilityKit'`. Build them against the full OpenHarmony SDK by unpacking its components into `<root>/<os>/<api>` of a separate SDK root and pointing `ONIRO_SDK_ROOT_DIR` at that root.
592
+ Apps like these usually also call system APIs (`@systemapi`), which the public SDK that `sdk install` downloads leaves out: the build fails with errors such as `'config' is not exported from Kit '@kit.AccessibilityKit'`. Build them against the full OpenHarmony SDK, installed with `sdk install --from-archive` (see [Full SDK](#full-sdk)).
543
593
 
544
594
  The `signingConfigs` block written to `build-profile.json5` mirrors the names used by the project's `products[*].signingConfig` (e.g. `applications/standard/systemui` uses `release`, `launcher` uses `default`). If the project has no products section, `default` is used, and a product that names no `signingConfig` is pointed at it.
545
595