Bought a run and hongmeng development board, the environment has not been built several times. The document that basically is official gives has very big confusion, record build successful process

This is a combination of tutorials from the following three websites. The system is Ubuntu 20.04. This article is to build the Ubuntu environment, source code compilation, Windows is only responsible for burning.

  1. Hongmeng official website
  2. Bear pie open source community
  3. Embellish and software

I. Software installation

names Use instructions Version for Access to
Visual Studio Code Code editing tool V1.53 or later 64-bit version. code.visualstudio.com/Download
Python Compile build tool 3.8.x 64-bit version For details about how to install the CLI tool, seeInstall Python.
Node.js providenpmThe environment V12.0.0 or later 64-bit version Nodejs.org/zh-cn/downl…
hpm Package management tool The latest version Please refer to theInstall the Hpm.
DevEco Device Tool HarmonyOSSource compilation, burning, debugging plug-in tools V2.2 Beta1 Device.harmonyos.com/cn/ide#down…

1 you need toshelltodash

  1. Open the terminal tool, run the following command, enter the password, and select No to change the Ubuntu shell to bash.

    sudo dpkg-reconfigure dash
    Copy the code
  2. Run the following command to confirm that bash is displayed

    ls -l /bin/sh
    Copy the code

2 the installationPython

  1. Ubuntu20 has Python 3.8 installed by default, so there is no need to install Python separately, but PIP is not installed

    sudo apt-get install python3-pip && python3 -m pip install --upgrade pip
    Copy the code
  2. In the source

    pip3 config set global.trusted-host repo.huaweicloud.com
    pip3 config set global.index-url https://repo.huaweicloud.com/repository/pypi/simple
    pip3 config set global.timeout 120
    Copy the code
  3. Setting a Soft connection

    Sudo ln -s /usr/bin/python3.8 /usr/bin/python3 sudo ln -s /usr/bin/python3.8 /usr/bin/python sudo ln -s /usr/bin/pip3 /usr/bin/pip#Test whether the installation is complete
    python --version
    pip --version
    Copy the code

3 the installationNode.js

Tar -xvf nod-vs1x.xx.x-linux-x64.tar. xz # Change the node name to sudo mv nod-vs1x.xx.x-linux-x64 /usr/local/nodejs sudo ln -s / usr/local/nodejs/bin/NPM/usr/bin/sudo ln -s/usr/local/nodejs/bin/node/usr/bin/node - v # test whether the installation is completeCopy the code

4 the installationHpm

NPM config set registry https://repo.huaweicloud.com/repository/npm/ NPM install - g @ ohos/HPM - cli HPM - V # test whether the installation is completeCopy the code

5 installationVisual Studio Code

sudo dpkg -i code_1.xx.x-1615806378_amd64.deb
code --version
Copy the code

6 Installing Others

sudo pip3 install setuptools sudo pip3 install kconfiglib sudo pip3 install pycryptodome sudo pip3 install six --upgrade  --ignore-installed six sudo pip3 install ecdsa#Install sconsSudo apt-get install scons -y scons -v #Copy the code

7 installationDevEco Device Tool

Note: Close Visual Studio Code before installing DevEco Device Tool.

Unzip devicetool-linux-tool-2.1.0.0.zip chmod u+x deveco-device-tool-2.1.0+241710.14bbf65d.run . / deveco device - tool - 2.1.0 + 241710.14 bbf65d. Run#After the installation is complete, there may be warnings. Execute the command as prompted. You can continue with the previous command to test for warnings
Copy the code

Two, the tool chain installation

Tool Package Name Get the address Specifies the path to be set in Tools
gn Repo.huaweicloud.com/harmonyos/c… gnFolder where the execution file resides
ninja Repo.huaweicloud.com/harmonyos/c… ninjiaFolder where the execution file resides
gcc_riscv32 Repo.huaweicloud.com/harmonyos/c… gcc_riscv32folder
mkdir ~/HarmonyOS 
mkdir ~/HarmonyOS/HarmonyOSTools~/HarmonyOS/HarmonyOSTools
#To download the installation package under the ~ / HarmonyOS HarmonyOSTools
#Decompress the Installation PackageTar tar -xvf ninja.1.9.0.tar tar -xvf gcc_riscv32-linux-7.3.0.tar.gz#Setting environment variables
vim ~/.bashrc
#.bashrc is added last
export PATH=~/HarmonyOS/HarmonyOSTools/gcc_riscv32/bin:$PATH
export PATH=~/HarmonyOS/HarmonyOSTools/ninja:$PATH
export PATH=~/HarmonyOS/HarmonyOSTools/gn:$PATH
Copy the code

At this point the Ubuntu compilation environment has been installed and the code can be compiled directly. But you also need a Window environment

Three,WindowsEnvironment set up

1 Mapping project source code

Run the following command under ==ubuntu== :

#Install samba
sudo apt install samba
#Configuring samba
sudo vim /etc/samba/smb.conf
#----------------------------------------------------------
[HarmonyOS]
path = /home/noob/HarmonyOS
available = yes
valid users = yes
read only = no
browsable = yes
public = yes
writable = yes
#----------------------------------------------------------
sudo smbpasswd -a noob
sudo service smbd restart 
Copy the code

2 the installationWindowsdrive

The development tools use Access to
CH341SER.EXE USBTo the serial port driver. www.wch.cn/search?q=ch…
HiburnBurn tool Code burning tool. Pan.baidu.com/s/1bp2ypAfH…

3 Map the network driver

Right click on this computer map network drive

Fill in the IP \ \ \ HarmonyOS