@@ -231,7 +231,7 @@ You should override **onDestroy** to delete widget data.
}
```
For details about the persistence method, see [Lightweight Data Store Development](../database/database-preference-guidelines.md).
For details about the persistence method, see [Lightweight Data Store Development](../database/database-storage-guidelines.md).
Note that the **Want** passed by the widget host to the widget provider contains a temporary flag, indicating whether the requested widget is a temporary one.
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -77,7 +77,7 @@ Checks whether this application is running in a RAM constrained device. This API
| Type| Description|
| -------- | -------- |
| Promise<boolean> | Promise used to return whether the application is running in a RAM constrained device. If the application is running in a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
| Promise<boolean> | Promise used to return whether the application is running on a RAM constrained device. If the application is running on a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
**Example**
...
...
@@ -93,7 +93,7 @@ Checks whether this application is running in a RAM constrained device. This API
@@ -101,7 +101,7 @@ Checks whether this application is running in a RAM constrained device. This API
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<boolean> | No| Callback used to return whether the application is running in a RAM constrained device. If the application is running in a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
| callback | AsyncCallback<boolean> | No| Callback used to return whether the application is running on a RAM constrained device. If the application is running on a RAM constrained device, **true** will be returned; otherwise, **false** will be returned.|
**Example**
...
...
@@ -214,4 +214,4 @@ Obtains information about the running processes. This API uses an asynchronous c
| pid<sup>8+</sup> | Read only | number | No | Process ID. |
| uid<sup>8+</sup> | Read only | number | No | User ID.|
| processName<sup>8+</sup> | Read only | string | No | Process name.|
| bundleNames<sup>8+</sup> | Read only | Array\<string> | No | **bundleName** array in the running process.|
| bundleNames<sup>8+</sup> | Read only | Array\<string> | No | **bundleName** array in the running processes.|
- The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
- The APIs of this module will be deprecated and are not recommended for use. An exception will be thrown if any of the APIs is called.
## Modules to Import
```js
importdocumentfrom'@ohos.document';
```
## document.choose
choose(type:string[]): Promise<string>
Chooses a file of the specified type using the file manager. This method uses a promise to return the result.
@@ -29,7 +29,7 @@ Touch target configuration is not supported.
| Name | Type | Default Value | Description |
| -------- | -------- | -------- | -------- |
| tabBar | string \| {<br/>icon?: string,<br/>text?: string<br/>}<br/>\|[CustomBuilder](../../ui/ts-types.md) | - | Content displayed on the tab bar.<br/>**CustomBuilder**: builder, to which components can be passed (applicable to API version 8 and later versions).<br/>> **NOTE**<br/>> If an icon uses an SVG image, the width and height attributes of the SVG image must be deleted. Otherwise, the icon size will be determined by the width and height attributes of the SVG image. |
| tabBar | string \| {<br/>icon?: string,<br/>text?: string<br/>}<br/>\|[CustomBuilder](../../ui/ts-types.md)<sup>8+</sup> | - | Content displayed on the tab bar.<br/>**CustomBuilder**: builder, to which components can be passed (applicable to API version 8 and later versions).<br/>> **NOTE**<br/>> If an icon uses an SVG image, the width and height attributes of the SVG image must be deleted. Otherwise, the icon size will be determined by the width and height attributes of the SVG image. |
> - The **<TabContent>** component does not support setting of the common width attribute. By default, its width is the same as that of the parent **<Tabs>** component.
This API creates a button that contains child components. In the syntax, **type** indicates the button type, and **stateEffect** indicates whether to enable the click effect for the button.
This API creates a button that does not contain any child components. In the syntax, **label** indicates whether the created button contains child components.
@@ -68,18 +68,18 @@ Use the **type** parameter to set the button type to **Capsule**, **Circle**, or
- Set the border radius:
In general cases, you can use universal attributes to define the button styles. For example, you can use the **borderRadius** attribute to set the border radius.
| screen | Media query based on screen-related parameters. |
### Media Logic Operation (and|not|only)
...
...
@@ -56,48 +56,48 @@ You can use logical operators (**and**, **or**, **not**, and **only**) to compos
**Table 1** Media logical operators
| Type| Description|
| -------- | -------- |
| and | The **and** operator is used to combine multiple media features into one media query, in a logical AND operation. The query is valid only when all media features are true. It can also combine media types and media functions.<br>For example, **screen and (device-type: wearable) and (max-height: 600) ** indicates that the query is valid when the device type is wearable and the maximum height of the application is 600 pixel units.|
| not | The **not** operator is used to perform a logical negation for a media query. **true** is returned if the query condition is not met. Otherwise, **false** is returned. In a media query list, logical negation is performed only for the media query using the **not** operator.<br>For example, **not screen and (min-height: 50) and (max-height: 600) ** indicates that the query is valid when the height of the application is less than 50 pixel units or greater than 600 pixel units.<br>>  **NOTE**<br>> When the **not** operator is used, the media type must be specified.|
| only | The **only** operator applies the selected style only when the entire expression is matched. It can be used to prevent ambiguity on browsers of earlier versions. The statements that contain both media types and media features produce ambiguity when they are received by some browsers of earlier versions. For example:<br>screen and (min-height: 50)<br>The browsers of earlier versions would mislead this sentence into screen, causing the fact that the specified style is applied when only the media type is matched. In this case, the **only** operator can be used to avoid this problem.<br>>  **NOTE**<br>> When the **only** operator is used, the media type must be specified.|
| ,(comma) | The **or** operator is used to combine multiple media features into one media query, in a logical OR operation. The query is valid if a media feature is true. The effect of a comma operator is equivalent to that of the **or** operator.<br>For example, **screen and (min-height: 1000), (round-screen: true) ** indicates that the query is valid when the minimum height of the application is 1000 pixel units or the device screen is round.|
| or | The **or** operator is used to combine multiple media features into one media query, in a logical OR operation. The query is valid if a media feature is true.<br>For example, **screen and (max-height: 1000) or (round-screen: true)** indicates that the query is valid when the maximum height of the application is 1000 pixel units or the device screen is round.|
| and | The **and** operator is used to combine multiple media features into one media query, in a logical AND operation. The query is valid only when all media features are true. It can also combine media types and media functions.<br>For example, **screen and (device-type: wearable) and (max-height: 600) ** indicates that the query is valid when the device type is wearable and the maximum height of the application is 600 pixel units. |
| not | The **not** operator is used to perform a logical negation for a media query. **true** is returned if the query condition is not met. Otherwise, **false** is returned. In a media query list, logical negation is performed only for the media query using the **not** operator.<br>For example, **not screen and (min-height: 50) and (max-height: 600) ** indicates that the query is valid when the height of the application is less than 50 pixel units or greater than 600 pixel units.<br>>  **NOTE**<br>> When the **not** operator is used, the media type must be specified. |
| only | The **only** operator applies the selected style only when the entire expression is matched. It can be used to prevent ambiguity on browsers of earlier versions. The statements that contain both media types and media features produce ambiguity when they are received by some browsers of earlier versions. For example:<br>screen and (min-height: 50)<br>The browsers of earlier versions would mislead this sentence into screen, causing the fact that the specified style is applied when only the media type is matched. In this case, the **only** operator can be used to avoid this problem.<br>>  **NOTE**<br>> When the **only** operator is used, the media type must be specified. |
| ,(comma) | The **or** operator is used to combine multiple media features into one media query, in a logical OR operation. The query is valid if a media feature is true. The effect of a comma operator is equivalent to that of the **or** operator.<br>For example, **screen and (min-height: 1000), (round-screen: true) ** indicates that the query is valid when the minimum height of the application is 1000 pixel units or the device screen is round. |
| or | The **or** operator is used to combine multiple media features into one media query, in a logical OR operation. The query is valid if a media feature is true.<br>For example, **screen and (max-height: 1000) or (round-screen: true)** indicates that the query is valid when the maximum height of the application is 1000 pixel units or the device screen is round. |
At MediaQuery Level 4, range query is imported so that you can use the operators including <=, >=, <, and > besides the **max-** and **min-** operators.
**Table 2** Logical operators for range query
| Type| Description|
| -------- | -------- |
| <= | Less than or equal to, for example, **screen and (50 <= height)**.|
| >= | Greater than or equal to, for example, **screen and (600 >= height)**.|
| <| Less than, for example, **screen and (50 < height)**.|
| >| Greater than, for example, **screen and (600 > height)**.|
| <= | Less than or equal to, for example, **screen and (50 <= height)**. |
| >= | Greater than or equal to, for example, **screen and (600 >= height)**. |
| < | Less than, for example, **screen and (50 < height)**. |
| > | Greater than, for example, **screen and (600 > height)**. |
### media-feature
| Type| Description|
| -------- | -------- |
| height | Height of the display area on the application page.|
| min-height | Minimum height of the display area on the application page.|
| max-height | Maximum height of the display area on the application page.|
| width | Width of the display area on the app page.|
| min-width | Minimum width of the display area on the application page.|
| max-width | Maximum width of the display area on the application page.|
| resolution | Resolution of the device. The unit can be dpi, dppx, or dpcm.<br>- **dpi** indicates the number of physical pixels per inch. 1 dpi ≈ 0.39 dpcm.<br>- **dpcm** indicates the number of physical pixels per centimeter. 1 dpcm ≈ 2.54 dpi.<br>- **dppx** indicates the number of physical pixels in each pixel. (This unit is calculated based on this formula: 96 px = 1 inch, which is different from the calculation method of the px unit on the page.) 1 dppx = 96 dpi.|
| min-resolution | Minimum device resolution.|
| max-resolution | Maximum device resolution.|
| orientation | Screen orientation.<br>Options are as follows:<br>- orientation: portrait<br>- orientation: landscape|
| device-height | Height of the device.|
| min-device-height | Minimum height of the device.|
| max-device-height | Maximum height of the device.|
| device-width | Width of the device.|
| min-device-width | Minimum width of the device.|
| max-device-width | Maximum width of the device.|
| round-screen | Screen type. The value **true** means that the screen is round, and **false** means the opposite.|
| dark-mode | Whether the device is in dark mode. The value **true** means that the device is in dark mode, and **false** means the opposite.|
| height | Height of the display area on the application page. |
| min-height | Minimum height of the display area on the application page. |
| max-height | Maximum height of the display area on the application page. |
| width | Width of the display area on the app page. |
| min-width | Minimum width of the display area on the application page. |
| max-width | Maximum width of the display area on the application page. |
| resolution | Resolution of the device. The unit can be dpi, dppx, or dpcm.<br>- **dpi** indicates the number of physical pixels per inch. 1 dpi ≈ 0.39 dpcm.<br>- **dpcm** indicates the number of physical pixels per centimeter. 1 dpcm ≈ 2.54 dpi.<br>- **dppx** indicates the number of physical pixels in each pixel. (This unit is calculated based on this formula: 96 px = 1 inch, which is different from the calculation method of the px unit on the page.) 1 dppx = 96 dpi. |
| min-resolution | Minimum device resolution. |
| max-resolution | Maximum device resolution. |
| orientation | Screen orientation.<br>Options are as follows:<br>- orientation: portrait<br>- orientation: landscape |
| device-height | Height of the device. |
| min-device-height | Minimum height of the device. |
| max-device-height | Maximum height of the device. |
| device-width | Width of the device. |
| min-device-width | Minimum width of the device. |
| max-device-width | Maximum width of the device. |
| round-screen | Screen type. The value **true** means that the screen is round, and **false** means the opposite. |
| dark-mode | Whether the device is in dark mode. The value **true** means that the device is in dark mode, and **false** means the opposite. |
## Example Scenario
...
...
@@ -139,7 +139,7 @@ Use media queries to apply different content and styles to the page text when th
}
```
When the device is in landscape orientation, the text content is displayed in landscape mode in the color of #FFD700.<br/>
# Use Case<a name="EN-US_TOPIC_0000001055686082"></a>
-For details about the development board, compilation, burning, and image running, see [Hi3518 Development Board](../quick-start/quickstart-lite-introduction-hi3518.md#section14815247616). A compilation result file of sample code is stored in **out/ipcamera\_hi3518ev300/dev\_tools/bin/camera\_sample**. You can copy the file to a TF card, or modify the compilation script of **camera\_sample** to copy the result to **rootfs.img**.
-A Hi318 compilation result file of sample code is stored in **out/ipcamera\_hi3518ev300/dev\_tools/bin/camera\_sample**. You can copy the file to a TF card, or modify the compilation script of **camera\_sample** to copy the result to **rootfs.img**.
Modify **output\_dir** in **applications/sample/camera/media/BUILD.gn**.
For details about the compilation and burning processes, see [Building Source Code](../quick-start/quickstart-lite-steps-hi3861-connection.md#section191121332125319) and [Burning Images](../quick-start/quickstart-lite-steps-hi3861-connection.md#section3288165814218) in the _Getting Started with Hi3861_.
For details about the compilation and burning processes, see [Building Source Code](../quick-start/quickstart-ide-lite-steps-hi3861-building.md) and [Burning Images](../quick-start/quickstart-ide-lite-steps-hi3861-burn.md) in the _Getting Started with Hi3861_.
After the preceding two steps are complete, press the **RST** button to reset the module. If the LED blinks periodically as expected, the verification is passed.
@@ -12,7 +12,7 @@ To accommodate different developer habits, OpenHarmony provides two modes for ge
- Installation package mode: Dependency download and installation as well as building operations are performed using commands. Burning and running are performed in DevEco Device Tool.
OpenHarmony also provides the [Docker environment](../get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
This document exemplifies how to use the IDE mode. For details about the installation package mode, see [Getting Started with Mini and Small Systems (Installation Package Mode)](../quick-start/quickstart-lite-package-directory.md).
This document exemplifies how to use the IDE mode. For details about the installation package mode, see [Getting Started with Mini and Small Systems (Installation Package Mode)](../quick-start/quickstart-lite-overview.md).
## Development Environment
...
...
@@ -28,7 +28,7 @@ This document describes how to develop OpenHarmony in the Windows+Ubuntu environ
## Development Boards
In this document, two development board models are used as examples: Hi3861 and Hi3516D V300. For details about these development boards, see [Appendix](../quick-start/quickstart-ide-lite-board-introduction.md). You can purchase the development board as required.
In this document, two development board models are used as examples: Hi3861 and Hi3516D V300. For details about these development boards, see [Appendix](../quick-start/quickstart-ide-lite-introduction-hi3861.md). You can purchase the development board as required.
@@ -12,7 +12,7 @@ To accommodate different developer habits, OpenHarmony provides two modes for ge
- Installation package mode: Dependency download and installation as well as building operations are performed using commands. Burning and running are performed in DevEco Device Tool.
OpenHarmony also provides the [Docker environment](../get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
This document exemplifies how to use the IDE mode. For details about the installation package mode, see [Getting Started with Standard System (Installation Package Mode)](../quick-start/quickstart-standard-package-directory.md).
This document exemplifies how to use the IDE mode. For details about the installation package mode, see [Getting Started with Standard System (Installation Package Mode)](../quick-start/quickstart-standard-overview.md).
## Development Environment
...
...
@@ -28,7 +28,7 @@ This document describes how to develop OpenHarmony in the Windows+Ubuntu environ
## Development Boards
In this document, two development board models are used as examples: Hi3516D V300 and RK3568. For details about these development boards, see [Appendix](../quick-start/quickstart-standard-board-introduction.md). You can purchase the development board as required.
In this document, two development board models are used as examples: Hi3516D V300 and RK3568. For details about these development boards, see [Appendix](../quick-start/quickstart-ide-standard-board-introduction-hi3516.md). You can purchase the development board as required.
> The U-Boot file can be obtained from the following path: device\hisilicon\hispark_taurus\sdk_liteos\uboot\out\boot\u-boot-hi3516dv300.bin.
2. Burn the U-Boot file by following the procedures for burning a U-Boot file over USB.
Select the U-Boot files of corresponding development boards for burning by referring to [Burning to Hi3516D V300](https://device.harmonyos.com/en/docs/documentation/guide/ide-hi3516-upload-0000001052148681)/[Burning to Hi3518E V300](https://device.harmonyos.com/en/docs/documentation/guide/ide-hi3518-upload-0000001057313128#section93591711580).
Select the U-Boot files of corresponding development boards for burning by referring to [Burning to Hi3516D V300](https://device.harmonyos.com/en/docs/documentation/guide/ide-hi3516-upload-0000001052148681).
3. Log in to the serial port after the burning is complete.
@@ -15,7 +15,7 @@ To accommodate different developer habits, OpenHarmony provides two modes for ge
- Installation package mode: Dependency download and installation as well as building operations are performed using commands. Burning and running are performed in DevEco Device Tool. OpenHarmony also provides the [Docker environment](../get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
This document exemplifies how to use the installation package mode. For details about the IDE mode, see [Getting Started with Mini and Small Systems (IDE Mode)](../quick-start/quickstart-lite-ide-directory.md).
This document exemplifies how to use the installation package mode. For details about the IDE mode, see [Getting Started with Mini and Small Systems (IDE Mode)](../quick-start/quickstart-ide-lite-overview.md).
## Development Environment
...
...
@@ -31,7 +31,7 @@ This document describes how to develop OpenHarmony in the Windows+Ubuntu environ
## Development Boards
In this document, two development board models are used as examples: Hi3861 and Hi3516D V300. For details about these development boards, see [Appendix](../quick-start/quickstart-lite-board-introduction.md). You can purchase the development board as required.
In this document, two development board models are used as examples: Hi3861 and Hi3516D V300. For details about these development boards, see [Appendix](../quick-start/quickstart-lite-introduction-hi3861.md). You can purchase the development board as required.
@@ -12,7 +12,7 @@ To accommodate different developer habits, OpenHarmony provides two modes for ge
- Installation package mode: Dependency download and installation as well as building operations are performed using commands. Burning and running are performed in DevEco Device Tool.
OpenHarmony also provides the [Docker environment](../get-code/gettools-acquire.md), which can significantly simplify the environment configuration before compilation. You can build your source code in the Docker environment if you are more accustomed to using the installation package mode.
This document exemplifies how to use the installation package mode. For details about the IDE mode, see [Getting Started with Standard System (IDE Mode)](../quick-start/quickstart-standard-ide-directory.md).
This document exemplifies how to use the installation package mode. For details about the IDE mode, see [Getting Started with Standard System (IDE Mode)](../quick-start/quickstart-ide-standard-overview.md).
## Development Environment
...
...
@@ -28,7 +28,7 @@ This document describes how to develop OpenHarmony in the Windows+Ubuntu environ
## Development Boards
In this document, two development board models are used as examples: Hi3516D V300 and RK3516. For details about these development boards, see [Appendix](../quick-start/quickstart-standard-board-introduction.md). You can purchase the development board as required.
In this document, two development board models are used as examples: Hi3516D V300 and RK3516. For details about these development boards, see [Appendix](../quick-start/quickstart-standard-board-introduction-hi3516.md). You can purchase the development board as required.
@@ -8,7 +8,7 @@ The following exemplifies how to run the first program on the development board.
The complete code directory is as follows:
```
applications/sample/hello
│ │── BUILD.gn
...
...
@@ -21,7 +21,7 @@ build
└── subsystem_config.json
productdefine/common
└── products
└── Hi3568DV300.json
└── Hi3516DV300.json
```
...
...
@@ -34,7 +34,7 @@ Perform the steps below in the source code directory:
Create the **applications/sample/hello/src/helloworld.c** directory and file whose code is shown in the following example. You can customize the content to be printed. For example, you can change **World** to **OH**. Declare the string printing function **HelloPrint** in the **helloworld.h** file. You can use either C or C++ to develop a program.
```
#include <stdio.h>
#include "helloworld.h"
...
...
@@ -55,7 +55,7 @@ Perform the steps below in the source code directory:
Add the header file **applications/sample/hello/include/helloworld.h**. The sample code is as follows:
```
#ifndef HELLOWORLD_H
#define HELLOWORLD_H
...
...
@@ -78,7 +78,7 @@ Perform the steps below in the source code directory:
2. Create a build file.
1. Create the **applications/sample/hello/BUILD.gn** file. The file content is as follows:
```
import("//build/ohos.gni") # Import the build template.
HiChecker is a framework provided by OpenHarmony for checking code errors and runtime results. It can be used for checking runtime errors during application and system development. This section applies only to the standard system.
## Development Guidelines
### Use Cases
HiChecker is provided for you to check issues that may be easily ignored during development of OpenHarmony applications (including system-built and third-party applications). Such issues include calling of time-consuming functions by key application threads, event distribution and execution timeout in application processes, and ability resource leakage in application processes. The issues are recorded in logs or lead to process crashes explicitly so that you can notice them and take correction measures.
### Available APIs
HiChecker provides the APIs listed in the following table.
**Table 1** HiChecker APIs
| **API**| **Description**|
| -------- | -------- |
| uint_64_t RULE_CAUTION_PRINT_LOG<br>= 1<<63; | Defines an alarm rule, which is programmed to record a log when an alarm is generated.|
| uint_64_t RULE_CAUTION_TRIGGER_CRASH = 1<<62; | Defines an alarm rule, which is programmed to force the application to exit when an alarm is generated.|
| uint_64_t RULE_THREAD_CHECK_SLOW_PROCESS = 1; | Defines a check rule, which is programmed to check whether any time-consuming function is called.|
| uint_64_t RULE_CHECK_SLOW_EVENT = 1<<32; | Defines a check rule, which is programmed to check whether the event distribution or processing time has exceeded the specified time threshold.|
| uint_64_t RULE_CHECK_ABILITY_CONNECTION_LEAK = 1<<33; | Defines a check rule, which is programmed to check ability leakage.|
| AddRule(uint_64_t rule) : void | Adds one or more rules. HiChecker detects unexpected operations or gives feedback based on the added rules.|
| RemoveRule(uint_64_t rule) : void | Removes one or more rules. The removed rules will no longer take effect.|
| GetRule() : uint_64_t | Obtains a collection of thread, process, and alarm rules that have been added.|
| Contains(uint_64_t rule) : bool | Checks whether the collection of added rules contains a specific rule. If a thread-level rule is specified, the system only checks whether it is contained in the current thread.|
| NotifySlowProcess(std::string tag) : void | Notifies your application of a slow process so that your application avoids calling it directly in key threads.|
| NotifySlowEvent(std::string tag) : void | Notifies your application that event distribution or execution has timed out.|
| NotifyAbilityConnectionLeak(Caution caution) : void | Notifies your application that AbilityConnection leakage has occurred.|
| GetTriggerRule() : uint_64_t | Obtains the rule that triggers the current alarm.|
| GetCautionMsg() : std::string | Obtains the alarm message.|
| GetStackTrace() : std::string | Obtains the stack when an alarm is triggered.|
### Development Example
C++
1. Include the following HiChecker header file in the code file:
```
#include "hichecker.h"
```
For a non-DFX subsystem, add the **HiviewDFX** field.
```
using namespace OHOS::HiviewDFX;
```
Use related APIs through static calls.
```
HiChecker::AddRule(Rule::RULE_THREAD_CHECK_SLOW_PROCESS); // Add a rule.
Notifies your application that AbilityConnection leakage has occurred. The following example shows that a **Caution** instance is passed into this API.
HiDumper is a tool provided by OpenHarmony for developers, testers, and IDE tool engineers to obtain system information necessary for analyzing and locating faults. This section applies only to the standard system.
### Source Code Directories
```
/base/hiviewdfx/hidumper
├── frameworks # Framework code
│ ├── native # Core function code
│ │ │── include # Header files
│ │ │── src # Source files
│ │ │── common # Common function code
│ │ │── executor # Process executor code
│ │ │── factory # Factory code
│ │ │── manager # Core manager code
│ │ │── util # Utility source code
│── sa_profile # HiDumper SA profile
│── services # HiDumper service code
│ │── native # C++ service code
│ │── zidl # Communication function
│ │ │── include # Header files of the communication function
│ │ │── src # Source code of the communication function
├── test # Test cases
│ ├── unittest # Unit test code
│ ├── moduletest # Module-level test code
```
## Usage
### Command-Line Options
**Table 1** HiDumper command-line options
| Option| Description|
| -------- | -------- |
| -h | Shows the help Information.|
| -t [timeout] | Specifies the timeout period, in seconds. The default value is **30**. Value **0** indicates no timeout limit.|
| -lc | Shows the system information cluster list.|
| -ls | Shows the system ability list.|
| -c | Exports system cluster information.|
| -c [base system] | Exports system cluster information based on **base** or **system** tags.|
| -s | Exports all system ability information.|
| -s [SA0 SA1] | Exports ability information corresponding to SA0 and SA1.|
| -s [SA] -a ['-h'] | Exports the system ability information **SA** using the **-h** parameter.|
| -e | Exports crash logs generated by the FaultLogger module.|
| --net | Exports network information.|
| --storage | Exports storage information.|
| -p | Exports the process list and all process information.|
| -p [pid] | Exports all information about a specified process.|
| --cpuusage [pid] | Exports the CPU usage information based on **pid**.|
| --cpufreq | Exports the actual CPU frequency.|
| --mem [pid] | Exports the memory usage information based on **pid**.|
| --zip | Compresses the exported information to a specified folder.|
### Development Example
HiDumper helps you export basic system information to locate and analyze faults. Complex parameters passed to sub-services and abilities must be enclosed in double quotation marks.
The procedure is as follows:
1. Access the device CLI, and run the **hidumper -h** command to obtain the help information, which includes basic information and function syntax.
```
hidumper -h
```
2. Run the **hidumper -lc** command to obtain the system information cluster list.
```
hidumper -lc
```
3. Run the **hidumper -c** command to obtain all information that is classified by **base** and **system**.
```
hidumper -c
```
4. Run the **hidumper -c [base | system]** to obtain the system cluster information that is classified by **base** or **system**.
```
hidumper -c base
hidumper -c system
```
5. Run the **hidumper -ls** command to obtain the system ability list.
```
hidumper -ls
```
6. Run the **hidumper -s** command to obtain all system ability information.
```
hidumper -s
```
7. Run the **hidumper -s 3301 -a "-h"** command to obtain the help information about the ability whose ID is **3301**.
```
hidumper -s 3301 -a "-h"
```
8. Run the **hidumper -s 3008** command to obtain all information about the ability whose ID is **3008**.
```
hidumper -s 3008
```
9. Run the **hidumper -e** command to obtain the crash information generated by the FaultLogger module.
```
hidumper -e
```
10. Run the **hidumper --net** command to obtain network information.
```
hidumper --net
```
11. Run the **hidumper --storage** command to obtain storage information.
```
hidumper --storage
```
12. Run the **hidumper -p** command to obtain process information, including the list and information of processes and threads.
```
hidumper -p
```
13. Run the **hidumper -p 1024** command to obtain information about the process whose PID is **1024**.
```
hidumper -p 1024
```
14. Run the **hidumper --cpuusage [pid]** command to obtain the CPU usage information of the process whose PID has been specified.
```
hidumper --cpuusage
hidumper --cpuusage 1024
```
15. Run the **hidumper --cpufreq** command to obtain the actual operating frequency of each CPU core.
```
hidumper --cpufreq
```
16. Run the **hidumper --mem [pid]** command to obtain all memory usage information of the process whose PID has been specified.
```
hidumper --mem [pid]
```
17. Run the **hidumper --zip** command to compress data to the **/data/dumper** directory.
```
hidumper --zip
```
18. Run the **hidumper -t timeout** command to set the timeout period, in seconds. The default value is **30**. Value **0** indicates no timeout limit.
@@ -31,4 +34,3 @@ Event logging means to collect and log events reported during system running. Th
**System event**
A system event is an indication of the system status at a given time point during system running. You can use these events to analyze the status change of the system.