同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Acquiring the Device Development Tool (HUAWEI DevEco Device Tool)
Acquiring the Application Development Tool (HUAWEI DevEco Studio)
OpenHarmony provides the following two types of Docker environments for you to quickly get the development environment ready:
HPM-based Docker environment: applicable when using the HarmonyOS Package Manager (HPM) to build a distribution.
Standalone Docker environment: applicable when using Ubuntu or Windows to build a distribution.
The following table lists container-based options needed for building in the standalone Docker environment.
Table 1 Docker image
swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker |
The build environment for the OpenHarmony version has been pre-installed. |
docker_dist is a template component in the HPM system. It helps to quickly initialize an HPM project and use the Docker image to quickly build a distribution of OpenHarmony, greatly simplifying environment configurations needed for building. After configuring the Ubuntu and hpm-cli development environments, perform the following steps to access the Docker environment:
Setting Up the Docker Environment
Initialize the installation template by running the following command in any of the working directories:
hpm init -t @ohos/docker_dist
Modify the publishAs field.
Open the bundle.json file in the current directory and change the value of publishAs from template to distribution as needed.
Select the desired solution, and set the environment variables for the solution distribution.
ip_camera_hi3516dv300:
export solution=@ohos/ip_camera_hi3516dv300
ip_camera_hi3518ev300:
export solution=@ohos/ip_camera_hi3518ev300
wifiiot:
export solution=@ohos/wifi_iot
Run the following Windows CMD command:
set solution=Distribution name
Building
Start building. The following takes ip_camera_hi3518ev300 as an example. Docker can be automatically installed only on Ubuntu. If you are using any other operating system, manually install Docker before pulling the image.
Automatically Installing Docker (Ubuntu)
Running the following command will automatically install the Docker, pull the image, and start the pulling and building of the corresponding solution in the container.
hpm run docker
The following will be displayed if the building is successful:
...
ohos ipcamera_hi3518 build success!
@ohos/ip_camera_hi3518ev300: distribution building completed.
Manually Installing Docker (Non-Ubuntu)
Perform the following operations to install Docker:
# Pull the image.
docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.2
# Build the distribution on Linux.
hpm run distWithDocker
# When using Windows, make sure to configure the Git Bash.
hpm config set shellPath "Git Bash path"
hpm run distWithDocker
The Docker image of OpenHarmony is hosted on HUAWEI Cloud SWR. Using the Docker image will help simplify environment configurations needed for the building. After configuring the development environments, perform the steps below to access the Docker environment. The following steps use Ubuntu as an example (Windows is also supported).
Method 1: Obtaining the Docker image from HuaweiCloud SWR
Obtain the Docker image.
docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.3
Go to the root directory of OpenHarmony code and run the following command to access the Docker build environment:
docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker:0.0.3
Method 2: Using the Dockerfile to Build a Local Docker Image
Obtain the Dockerfile script for a local Docker image.
git clone https://gitee.com/openharmony/docs.git
Go to the directory of the Dockerfile code and run the following command to build the Docker image:
cd docs/docker
./build.sh
Go to the root directory of OpenHarmony code and run the following command to access the Docker build environment:
docker run -it -v $(pwd):/home/openharmony openharmony-docker:0.0.3
The following uses the Hi3516 platform as an example to describe the build procedure. Run the following build scripts to start building:
Run the following command in the root directory of the source code to install hb:
python3 -m pip install --user build/lite
Set the build path to the current path.
hb set
.
NOTE: The mapping between the development board and the building GUI:
- Hi3861: wifiiot_hispark_pegasus@hisilicon
- Hi3516: ipcamera_hispark_taurus@hisilicon
- Hi3518: ipcamera_hispark_aries@hisilicon
Select ipcamera_hispark_taurus@hisilicon and press Enter.
Start building.
hb build -f
View the build result.
The files will be generated in the out/hispark_taurus/ipcamera_hispark_taurus directory.
HUAWEI DevEco Device Tool is a one-stop integrated development environment (IDE) provided to develop applications for OpenHarmony-based smart devices. It allows on-demand customization of OpenHarmony components, code editing, compilation, burning, and debugging, and supports C and C++ languages. This tool is installed in Visual Studio Code as a plug-in. For details, see Tool Acquisition and HUAWEI DevEco Device Tool User Guide.
HUAWEI DevEco Studio (DevEco Studio for short) is a one-stop IDE oriented to Huawei devices in all scenarios. It provides E2E OpenHarmony application development services, ranging from project template creation to development, compilation, debugging, and release. With DevEco Studio, you will be able to efficiently develop OpenHarmony applications with distributed capabilities while speeding up innovation. For details, see Tool Acquisition and HUAWEI DevEco Studio User Guide.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。