OpenHarmony轻
量型设备开发入门
讲师:宋倩倩
润和软件
目录
• 环境准备
• 环境配置
• 源码下载与编译
• Samba配置
• 镜像烧录
• 串口调试工具使用
环境准备
• 硬件准备
1、Windows10 64位(DevEco Device Tool Windows开发环境)
参考链接:https://device.harmonyos.com/cn/docs/documentation/guide/install_windows-0000001050164976
2、Ubuntu18及以上版本(DevEco Device Tool Ubuntu开发环境)
参考链接:https://device.harmonyos.com/cn/docs/documentation/guide/install_ubuntu-0000001072959308
3、Windows + Ubuntu(本次课程讲解)
• 软件准备
1、代码编辑器(Visual Studio Code)
2、虚拟机(Virtual Box)(可选)
3、编译工具链
4、远程连接工具(MobaXterm)(可选)
5、烧录工具
6、串口驱动
7、串口调试工具
环境配置--Visual Studio Code安装
• 下载链接
h t t p s : / / c o d e . v i s u a l s t u d i o . c o m / D o w n l o a d
• 安装步骤
1、根据下载链接下载安装包
2、双击安装包开始安装,安装过程中主要要勾选“ 添 加 到 P A T H ( 重 启 后 生
效 ) ” , 安 装 完 成 后 , 重 启 计 算 机 。
参考链接:https://blog.csdn.net/weixin_37590454/article/details/89436577
环境配置--虚拟机安装
• 下载链接
https://www.virtualbox.org/wiki/Downloads
• 安装步骤
1、根据下载链接下载安装包
2、双击安装包开始安装,安装过程中要勾选“ Create a shortcut on the desktop”和”Create
a shortcut in the Quick Lanch Bar”, 安 装 完 成 后,可以选择直接开启VirtualBox软件。
参考链接:https://blog.csdn.net/gufenchen/article/details/91357656
环境配置--安装Ubuntu20.04
• ubuntu-20.04-desktop-amd64.iso下 载 链 接
https://mirrors.tuna.tsinghua.edu.cn/ubuntu-releases/20.04/
• 安装步骤
1、根据下载链接下载安装包
2、创建Ubuntu虚拟机
3、安装Ubuntu以及相关配置(配置两个虚拟网卡,一个配置为HostOnly,混杂模式:全部允许,
另一个为网络地址转换(NAT),混杂模式:全部允许)
参考链接:https://www.jianshu.com/p/796866e933e1
环境配置--基础软件安装
• 安装linux使用基础软件
1、sudo apt-get update && sudo apt-get install -y vim net-tools
--sudo apt-get update 更新软件列表
--vim linux 编辑器
--net-tools linux网络工具(ifconfig查看网络工具)
2、sudo apt-get install -y openssh-server
--openssh-server ssh服务,便于ssh远程连接
环境配置--MobaXterm远程登录虚拟机(可选)
• MobaXterm下载连接:
https://mobaxterm.mobatek.net/download.html
• 安装步骤
直接双击安装即可。
ifconfig查看虚拟机IP