This post was last edited by Unseen on 2021-7-1 00:24
In the previous chapter, we used command line tools to compile a project. In actual use, downloading and installing various command line tools is very complicated. I have been struggling with the environment for a long time in the past few days. Then I found this official plug-in version of IDE based on VSCode, which can easily create new projects.
1. Prepare the installation package
1.1. Installation software and installation steps to be performed
- Install Visual Studio Code
- Install Python
- Install Node.js
- Install hpm
- Install the DevEco Device Tool plugin
1.2. Download and install VSCode, which requires 64-bit version V1.53 or above. The download link is not mentioned here.
1.3. Download and install Python. The required version is 3.7.4-3.8.x 64-bit version. Download link . Be careful not to download python 3.9 or above, as strange problems may occur. It is not recommended for novices to install.
1.4. Install nodejs. Please choose the appropriate version to download according to your system type, v12.0.0 and above 64-bit version, download link .
1.5. Install the hpm package management tool. You only need to install the latest version:
- It is recommended to change the source to Huawei source: You can enter in the command line of vscode: $ npm config set registry https://repo.huaweicloud.com/repository/npm/
- Run the command to install the latest version of hpm: npm install -g @ohos/hpm-cli
- After the installation is complete, execute the following command (V is a capital letter) to check the hpm installation result: hpm -V. If the software version is displayed, it indicates that the installation is correct.
1.6. Install the DevEco Device Tool plug-in. The host user name cannot contain Chinese characters , otherwise it may cause errors during operation. The normal operation of DevEco Device Tool depends on the C/C++ and CodeLLDB plug-ins. After installing DevEco Device Tool, the C/C++ and CodeLLDB plug-ins will be automatically installed from the Visual Studio Code plug-in market. Therefore, before installing DevEco Device Tool, please check the network connection status of Visual Studio Code. If the network cannot directly access the Internet, it needs to be accessed through a proxy server. Please set up the Visual Studio Code proxy first .
2. New Construction
2.1. Open the DevEco Device Tool plug-in, and you can create a new project in a graphical way. Surprisingly, the official has supported the bearpi development board (needs to be in Linux mode), so we can directly choose the bearpi development board for development.
2.2 Enter the name of the project you want to create and select the Bear Pi development board. Click Create to create a new project.
2.3 After clicking Create, some tools will be automatically downloaded until a pop-up window with the word "successfully" appears in the upper right corner, indicating that the creation is complete.
2.4 Click OPEN to open the project. Now, you can happily develop in vscode.