1 Star 0 Fork 5.1K

youguilin / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
preparations.md 3.58 KB
一键复制 编辑 原始数据 按行查看 历史
mamingshuai 提交于 2021-06-02 01:00 . update OpenHarmony 2.0 Canary

Preparations

Hardware Requirements

  • Development boards (examples: Hi3861, Hi3516DV300, and Hi3518EV300)
  • Host computer (Windows workstation)
  • Linux server

Figure 1 Hardware connections

Installing Node.js and the hpm-cli Tool

  1. Install Node.js.

    Download Node.js from its official website and install it on your local PC.

    You are advised to install Node.js 12.x (including npm 6.14.4) or a later version (12.13.0 or later is recommended).

  2. Install the hpm-cli tool using npm delivered with Node.js. Run the following command:

    npm install -g @ohos/hpm-cli
  3. Run the following command to check whether the installation is successful. If an HPM version is displayed, the installation is successful.

    hpm -V or hpm --version
  4. (Optional) Run the following command to upgrade the HPM version if needed:

    npm update -g @ohos/hpm-cli

(Optional) Modifying HPM Configurations

After the hpm-cli tool is installed, run the following command to view HPM configurations:

hpm config

Default HPM configurations are displayed upon the command execution. You can modify the default configurations as required. The following lists common HPM configurations:

registry = https://hpm.harmonyos.com/hpm/registry/api              # Configure the address of the HPM registry, mandatory for downloading bundles.
login = https://hpm.harmonyos.com/hpm/auth/pk                      # Configure the address for HPM login, mandatory for publishing bundles.
loginUser = {your-account}                                         # Configure the account for HPM login, mandatory for publishing bundles.
shellPath = C:\WINDOWS\System32\cmd.exe                            # Configure the shell for running HPM commands.
globalRepo = C:\Users\yourname\.global                             # Configure the path for storing bundles that are installed globally.
http_proxy = http://your-proxy-server:port                         # Configure the HTTP proxy.
https_proxy = http://your-proxy-server:port                        # Configure the HTTPS proxy.

For details about hpm-cli commands, see HPM Commands.

Downloading OpenHarmony Code

For details, see Source Code Acquisition.

Installing Dependent Bundles

The HPM publishes commonly used development tools (such as those for burning, compiling, and compression) as bundles. You can run the following command to install these tools. After the command is executed, the system automatically downloads and installs the tools, which need to be installed globally only once.

hpm i -g @ohos/llvm
hpm i -g @ohos/ninja
hpm i -g @ohos/gn
hpm i -g @ohos/hc_gen
hpm i -g @ohos/sysroot

These are a set of development tools (such as gn and ninja). With these tools, you can start your general bundle development based on source code.

1
https://gitee.com/yougl/docs.git
git@gitee.com:yougl/docs.git
yougl
docs
docs
master

搜索帮助