安装OpenHarmony编译库和工具集

一、搭建开发环境

1.1、Ubuntu搭建,参考

VMware完美安装Ubuntu20.04-CSDN博客文章浏览阅读286次,点赞5次,收藏3次。详细介绍了VMware下安装Ubuntu20.04https://blog.csdn.net/longyuzi/article/details/139935769

1.2、拉取OpenHarmony源码

OpenHarmony源码获取-CSDN博客文章浏览阅读116次,点赞3次,收藏2次。OpenHarmony是由开放原子开源基金会(OpenAtom Foundation)孵化及运营的开源项目,目标是面向全场景、全连接、全智能时代,搭建一个智能终端设备操作系统的框架和平台,促进万物互联产业的繁荣发展。本文详细介绍了如何通过码云拉去代码https://blog.csdn.net/longyuzi/article/details/140064404

 1.3、添加华为云源

打开source.list,并添加华为云源

sudo vim /etc/apt/sources.list

deb http://repo.huaweicloud.com/ubuntu/ bionic main multiverse restricted universe
deb http://repo.huaweicloud.com/ubuntu/ bionic-updates main multiverse restricted universe
deb http://repo.huaweicloud.com/ubuntu/ bionic-security main multiverse restricted universe
deb http://repo.huaweicloud.com/ubuntu/ bionic-backports main multiverse restricted universe

1.4、将Ubuntu环境修改为bash

执行如下命令,确认输出结果为bash。如果输出结果不是bash,请根据子步骤,将Ubuntu shell修改为bash。

ls -l /bin/sh

打开终端工具,执行如下命令,输入密码,然后选择No,将Ubuntu shell由dash修改为bash。 

sudo dpkg-reconfigure dash

1.5、将Python 3.8设置为默认Python版本。

查看Python 3.8的位置:

which python3.8

将Python和Python3切换为Python 3.8:

sudo update-alternatives --install /usr/bin/python python {Python 3.8 路径} 1    #{Python 3.8 路径}为上一步查看的Python 3.8的位置
sudo update-alternatives --install /usr/bin/python3 python3 {Python 3.8 路径} 1   #{Python 3.8 路径}为上一步查看的Python 3.8的位置

二、安装库和工具集

2.1、用脚本安装库,在当前工程目录执行:

./build/build_scripts/env_setup.sh

2.2、安装工具集

bash build/prebuilts_download.sh

2.3、安装编译环境

python3 -m pip install --user ohos-build

设置环境变量

vim ~/.bashrc
export PATH=~/.local/bin:$PATH
source ~/.bashrc

三、编译

hb set 

编译成功的log可以在资源里下载

https://download.csdn.net/download/longyuzi/89496226icon-default.png?t=N7T8https://download.csdn.net/download/longyuzi/89496226

  • 12
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

龙山升龙霸

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值