Development Example
The following uses the Hi3861 platform as an example to describe how to install and build bundles by using the hpm.
-
Run the following commands to create a directory (its name can be customized) and create a default project based on the dist template:
mkdir test3861 cd test3861 hpm init -t dist myproduct
If the following information is displayed, the project is created:
Initialization finished.
-
Run the following command to install the hispark_pegasus distribution:
hpm install @ohos/hispark_pegasus
If the following information is displayed, the installation is successful:
Installed.
NOTE: If you are using the Hi3516 platform, run the following command:
hpm install @ohos/hispark_taurus
If you are using the Hi3518 platform, run the following command:
hpm install @ohos/hispark_aries
-
Run the following command to build and package bundles:
hpm dist
If the building is successful, the following information is displayed:
{{name}}: distribution building completed.
-
Check the result in the ./out directory. You can burn the distribution into the corresponding development board for testing.