当前位置:网站首页>Get the openharmony source code: get it from the deveco marketplace (1)
Get the openharmony source code: get it from the deveco marketplace (1)
2022-06-21 20:52:00 【51CTO】
introduction
OpenHarmony There are three ways to obtain the source code : from gitee、GitHub Based on git Code hosting platform for ; From Huawei DevEco Marketplace Website access ; Get... From the mirror site .
This article introduces how to use the DevEco Marketplace Website access OpenHarmony Source code , And in Ubuntu Create a Hongmeng project in the Hongmeng equipment development environment under the system .
One 、DevEco Marketplace brief introduction
In Huawei DevEco Marketplace In this website , There are many open source Hongmeng distributions . Most of these open source distributions are for a specific device ( Such as : A development board ), Yes OpenHarmony The full amount of code has been trimmed . such as , A device has limited hardware resources , Can't run OpenHarmony Some functional components in , Then these components will be cut out in the distribution ; In other words, there is no need for a certain function in the application scenario of this device , The corresponding functional components will also be cut in the distribution .
We are developing Hongmeng equipment , You can go to this website to find out if there is a suitable distribution . This site also supports adding or removing some functional components from these distributions , Customize a release . You can also submit your own distribution to this website for open source use .
DevEco Marketplace The front page of this website is shown in the figure below . For Hongmeng equipment development , Here's the important thing Device components and file . Developers can find various open source distributions and component packages in the device components ; The documentation details how to get the distribution 、 The component package , How to customize a distribution , And how to contribute your own distributions and component packages .

below , With Hi3861 Take a development board of the processor as an example , Explain Huawei's DevEco Marketplace Website access OpenHarmony Source code and the process of creating Hongmeng project .
Be careful : from DevEco Marketplace The website needs to register a Huawei account to download and contribute code .
Two 、 Get Hongmeng distribution
Reference resources : https://gitee.com/openharmony/docs/blob/master/zh-cn/device-dev/get-code/sourcecode-acquire.md
2.1 install Node.js and HPM
To obtain the source code of the distribution, you need to use hpm Command line tools , and hpm Use Node.js Medium npm Installed , So install it first Node.js and hpm. For installation method, refer to part II, section 2.6~2.7 section :
《 Set up Hongmeng equipment development environment :Ubuntu20.04+DevEco Device Tool Release 3.0》 link
If you have built the Hongmeng device development environment according to the above article , Skip this step .
2.2 Get the profile of the distribution
1、 Get into DevEco Marketplace After the first page , Log in with your account first ( If you have not registered a Huawei account , Please register first ).
2、 open Device components page , choice Open source distribution , Use the... On the left side of the page filter Help find the required open source distribution , As shown in the figure below :

3、 Click the selected open source distribution , Such as : In the picture above WLAN Connection products , The details page of the latest version of the open source distribution will be opened , As shown in the figure below :

4、 On the right side of the details page , You can see the version number and release time , single click Direct download This version of the configuration file can be downloaded ( Don't click Download for now ); On the left side of the details page , You can see the description of the current version , single click edition , View all versions of this release , As shown in the figure below :

Click on any version , You can enter the details page of this version . You can also click the download icon on the far right of the version , Download the configuration file of this version directly .
Make a note of : 2022-06-18,3.1.0~3.1.2 There is a problem with both versions of the configuration file , Unable to successfully download the source code of this distribution . After submitting the problem to Huawei , Huawei acknowledges the existence of bug, I hope when you read this article , Has been repaired .
I've been using it before 2.2.0 edition , At least I don't have any problems right now ;3.0.1 The version of the configuration file has no problem in obtaining the source code , In this paper , Just use this version .
5、 single click 3.0.1 The download icon on the right side of the version , Download to get a .tgz Compressed files , I suggest you change the name of this compressed file , Change to the name of the Hongmeng project you want to create , for example :hispark_pegasus_301.tgz. I put this compressed file in ~/Documents/DevEco/Projects Under the table of contents .
2.3 Download the distribution source code
1、 Unzip the distribution profile zip hispark_pegasus_301.tgz.
Enter the folder where the compressed package is located :~/Documents/DevEco/Projects, Right click in the compressed file , choice Extract Here , You will get a file named hispark_pegasus_301 Folder .
2、 Enter folder hispark_pegasus_301, Right click an empty space in the folder , choose “Open in Terminal”, Open a terminal , Execute command in terminal :hpm install, That is, start to download the code of the distribution and the related tool chain ( Make sure you can connect to the Internet ).





After success , Hongmeng project folder hispark_pegasus_301 The file in is shown in the following figure :

If you're using 3.1.0~3.1.2 Version of the configuration file , The error shown in the following figure may appear ( At least 2022-06-18 The test is like this ):

3、 ... and 、 Create a Hongmeng project
Please first build the Hongmeng development environment according to the following article :
《 Set up Hongmeng equipment development environment :Ubuntu20.04+DevEco Device Tool Release 3.0》 link
DevEco Device Tool edition : devicetool-linux-tool-3.0.0.401.zip
1、 open DevEco Device Tool, stay “Home” Click on the page “Import Project”.

2、 Select the Hongmeng project folder in the pop-up window hispark_pegasus_301, Then click... In the lower right corner Import .

3、 In the pop-up window, click Import .

4、 choice Import from OpenHarmony Source .

5、 Select the development board according to the following figure 、 Processor and other information , And then click Open .

6、 Check the pop-up window , And then click Yes.

7、 The open Hongmeng project is shown in the following figure .

8、 Compile the project as shown in the following figure .


Postscript
We can actually be in DevEco Device Tool in , Complete the second part of this article in one stop 、 The work done in the three parts , However, it seems that you can only download the latest version of the distribution to create the Hongmeng project . So wait for Huawei to repair the above mentioned bug after , Please read my other article :
《 obtain OpenHarmony Source code : from DevEco Marketplace obtain (2)》
Supplement notes
We can also do that Ubuntu In the end , On the command line , Complete the search of Hongmeng distribution in turn 、 Download and compile .
Create a project folder ,
1、 see DevEco Marketplace What are the Hongmeng development boards on this website

Press n Turn to the next page , Press q sign out .
2、 Create a new project folder ( Such as :test), Then initialize

3、 Under the project folder , Execute the following command , Download the open source distribution source code and tool chain .

4、 compile
There are two ways to compile from the command line :
(1) Mode one : Execute the following command in the project folder

(2) Mode two : Execute the following commands in turn


In this paper CSDN、 official account 、 Headlines and Zhihu are released simultaneously , Thank you for attention .
边栏推荐
- EasyCVR智能边缘网关硬件如何设置通电自启动?
- Extend the clean, fresh and dense bag, and put a "safety lock" on the ingredients
- How to find the desired file among thousands of files on your computer?
- How to implement chat robot in naturallanguageprocessing?
- How to redeem financial products after the opening date?
- LeeCode198 打家劫舍
- What is more advantageous than domestic spot silver?
- Jingdong 39 year old "graduate" found a new job within a week after being laid off, with a salary increase of 20%!
- How to distinguish between machine learning and pattern recognition?
- What is the gateway
猜你喜欢

Ns32f103vbt6 hardware and software replace stm32f103vbt6

同步升压 DC/DC 转换器FS3400同步SOT23-6小电流500MA升压ic

带你区分几种并行

The second round of layoffs in a large factory is coming, and the routine is full

The highest monthly salary is 17k. As long as there is a field of hope in your heart, hard work will usher in a green land~

高性能内网DNS系统介绍

pfSense配置TINC站點至站點隧道教程

DO280OpenShift命令及故障排查--访问资源和资源类型

阿里云 ACK One、ACK 云原生 AI 套件新发布,解决算力时代下场景化需求

获取OpenHarmony源码:从DevEco Marketplace获取(1)
随机推荐
京东39岁“毕业生”被裁一周就找到新工作,涨薪20%!
FANUC机器人进行全部备份和镜像备份以及加载备份文件的具体操作(图文)
Netcore3.1 Ping whether the network is unblocked and obtaining the CPU and memory utilization of the server
Take off, annual salary: 400000+
Jenkins定时构建并传递构建参数
FM5012D小风扇集成ic方案
数据路:三人行,必有我师!
Xcode插件管理工具Alcatraz
Inno setup window drag learning
String类型转换成List<Integer>
Rongyun obtains token
阿里云 ACK One、ACK 云原生 AI 套件新发布,解决算力时代下场景化需求
高性能内网DNS系统介绍
AB打包有的Shader没有触发IPreprocessShaders的回调
Flutter TabBarView组件
Flutter PageView组件
Henkel database custom operator '! ~~'
Visualization of operation and maintenance monitoring data - let the data speak [Huahui data]
[summary of smart trash cans based on Hetai ht32f52352]
什么是eGFP,绿色荧光蛋白