赞
踩
虚拟机安装了,想要下载 OpenHarmony 代码、编译还缺少多个安装包(依赖库),请按照如下操作配置 OpenHarmony 虚拟机环境。
./out/rk3568/build.log
文件中搜索 error:
,查看到底缺少什么安装包,有时会直接提示你安装某个安装包会解决此问题;$ sudo apt-get install xxx
点击如下列图所示,逐步操作。
在终端执行以下语句:
- $ git config --global user.name "yourname"
- $ git config --global user.email "your-email-address"
$ ssh-keygen -t rsa -C [email]xxxxx@xxxxx.com[/email]
出现 Enter file 后路径回车到底。
$ cat ~/.ssh/id_rsa.pub
ssh-rsa [email]............@mail.com[/email]
$ ssh -T [email]git@gitee.com[/email]
sudo apt-get update && sudo apt-get install bc binutils binutils-dev bison build-essential ccache cpio curl default-jdk default-jre device-tree-compiler docker dosfstools dpkg-dev e2fsprogs fakeroot flex g++ gcc gcc-9-arm-linux-gnueabi gcc-arm-linux-gnueabi genext2fs git git-lfs gnupg gnutls-bin gperf lib32ncurses-dev lib32z1-dev libc6-dev-i386 libc6-dev-x32 libdwarf-dev libelf-dev libffi-dev libgl1-mesa-dev liblz4-tool libncurses5 libreadline-dev libssl-dev libtinfo5 libunwind-dev libx11-dev libxcursor-dev libxinerama-dev libxml2-utils libxrandr-dev locales m4 make mtd-utils mtools net-tools nfs-kernel-server nodejs npm openssl perl pkg-config python2 python3.8 python3-distutils python3-apt python3-distutils python3-minimal python3-pip python3-setuptools ruby samba scons smbclient ssh texinfo tree tzdata u-boot-tools unzip vim wget x11proto-core-dev xsltproc zip zlib1g-dev -y
sudo pip3 install setuptools kconfiglib pycryptodome ecdsa
特别感谢大佬奉献,让枯燥的工作变的高效。首先安装 samba 映射 Ubuntu 文件到 Windows,然后将以下脚本粘贴到 install.sh 文件中,拷贝到 Ubuntu,用 chmod 777 ./install.sh
修改权限,然后执行即可。
- #!/bin/bash
- echo "Enter your email: "
- read YOUR_EMAIL
- echo "Enter your name for git"
- read YOUR_NAME
-
- sudo apt update
-
- sudo apt install dosfstools mtools mtd-utils default-jre default-jdk python3.8 python3-setuptools python3-pip git git-lfs zip -y
-
- sudo rm -f /bin/sh
- sudo ln -s /bin/bash /bin/sh
-
- if [ -f /usr/bin/python ]; then
- sudo rm /usr/bin/python
- fi
- sudo ln -s /usr/bin/python3 /usr/bin/python
-
- sudo pip3 install setuptools kconfiglib pycryptodome ecdsa
-
- sudo pip3 install six
-
- # arg1=download URL; arg2=sha256 checksum URL
- # ret downloaded(0), already exist checksum right(1), download fialed(3)
- function DownloadAndCheck() {
- checkSumFile=`basename $2`
- downloadFile=`basename $1`
- echo "downloadFile=$downloadFile"
- echo "checksumFile=$checkSumFile"
- if [ -f $downloadFile ]; then
- curl $2 > $checkSumFile
- #echo " $downloadFile" >> $checkSumFile
- checkSum=`cat $checkSumFile`" $downloadFile"
- echo $checkSum
- echo $checkSum | sha256sum -c --status
- if [ $? -eq 0 ]; then
- return 1
- else
- rm $downloadFile
- fi
- fi
-
- wget $1
- sha256sum -c --status $checkSumFile
- if [ $? -eq 0 ]; then
- return 0
- else
- return 3
- fi
- }
-
- DownloadAndCheck "https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz" "https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz.sha256"
- mkdir -p ~/gn
- tar -xvf gn-linux-x86-1717.tar.gz -C ~/gn/
-
- DownloadAndCheck "https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar" "https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar.sha256"
- tar -xvf ninja.1.9.0.tar -C ~/
-
- if [ -f hapsigntoolv2.jar ]; then
- rm hapsigntoolv2.jar
- fi
- wget https://repo.huaweicloud.com/harmonyos/develop_tools/hapsigntoolv2.jar
- mkdir -p developtools
- mv hapsigntoolv2.jar developtools/hapsigntoolv2.jar
-
- DownloadAndCheck "https://repo.huaweicloud.com/harmonyos/compiler/clang/10.0.1-53907/linux/llvm.tar.gz" "https://repo.huaweicloud.com/harmonyos/compiler/clang/10.0.1-53907/linux/llvm.tar.gz.sha256"
- tar -xvf llvm.tar.gz -C ~/
-
- DownloadAndCheck "https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar" "https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar.sha256"
- tar -xvf hc-gen-0.65-linux.tar -C ~/
-
- echo "export PATH=~/gn:\$PATH" >> ~/.bashrc
- echo "export PATH=~/ninja:\$PATH" >> ~/.bashrc
- echo "export PATH=~/llvm/bin:\$PATH" >> ~/.bashrc
- echo "export PATH=~/hc-gen:\$PATH" >> ~/.bashrc
- echo "export PATH=~/llvm/bin:\$PATH" >> ~/.bashrc
- echo "export PATH=~/developtools:\$PATH" >> ~/.bashrc
- echo "export PATH=~/.local/bin:\$PATH" >> ~/.bashrc
- source ~/.bashrc
-
- if [ -f repo-py3 ]; then
- rm repo-py3
- fi
- wget https://gitee.com/oschina/repo/raw/fork_flow/repo-py3
- sudo mv repo-py3 /usr/local/bin/repo
-
- sudo chmod a+x /usr/local/bin/repo
- sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple requests
-
- git config --global user.name "YOUR_NAME"
- git config --global user.email "$YOUR_EMAIL"
- git config --global credential.helper store
-
- if [ ! -f ~/.ssh/id_rsa.pub ]; then
- ssh-keygen -t rsa -C "$YOUR_EMAIL"
- fi
-
- echo "Set the following PublicKey to gitee and press enter to continue"
- cat ~/.ssh/id_rsa.pub
- read READY
- echo "Checking PublicKey..."
- ssh -T [email]git@gitee.com[/email]

至此,下载 OpenHarmony 代码、编译的环境配置完成,万事俱备只欠“下载代码”,不要停,加油!
有很多小伙伴不知道学习哪些鸿蒙开发技术?不知道需要重点掌握哪些鸿蒙应用开发知识点?而且学习时频繁踩坑,最终浪费大量时间。所以有一份实用的鸿蒙(HarmonyOS NEXT)资料用来跟着学习是非常有必要的。
这份鸿蒙(HarmonyOS NEXT)资料包含了鸿蒙开发必掌握的核心知识要点,内容包含了(ArkTS、ArkUI开发组件、Stage模型、多端部署、分布式应用开发、音频、视频、WebGL、OpenHarmony多媒体技术、Napi组件、OpenHarmony内核、Harmony南向开发、鸿蒙项目实战等等)鸿蒙(HarmonyOS NEXT)技术知识点。
希望这一份鸿蒙学习资料能够给大家带来帮助,有需要的小伙伴自行领取,限时开源,先到先得~无套路领取!!
获取这份完整版高清学习路线,请点击→纯血版全套鸿蒙HarmonyOS学习资料
HarmonOS基础技能
有了路线图,怎么能没有学习资料呢,小编也准备了一份联合鸿蒙官方发布笔记整理收纳的一套系统性的鸿蒙(OpenHarmony )学习手册(共计1236页)与鸿蒙(OpenHarmony )开发入门教学视频,内容包含:ArkTS、ArkUI、Web开发、应用模型、资源分类…等知识点。
获取以上完整版高清学习路线,请点击→纯血版全套鸿蒙HarmonyOS学习资料
OpenHarmony北向、南向开发环境搭建
获取以上完整鸿蒙HarmonyOS学习资料,请点击→纯血版全套鸿蒙HarmonyOS学习资料
总的来说,华为鸿蒙不再兼容安卓,对中年程序员来说是一个挑战,也是一个机会。只有积极应对变化,不断学习和提升自己,他们才能在这个变革的时代中立于不败之地。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。