视频教程:
视频链接:https://www.bilibili.com/video/BV1G44y167Y2
[img]https://ss.csdn.net/p?
[/img]
鸿蒙2.0开发环境搭建教程
视频链接:https://www.bilibili.com/video/BV1to4y1y76W
[img]https://ss.csdn.net/p?
[/img]
手机鸿蒙2.0编译烧录教程
1.环境搭建1.1 搭建ubuntu环境,下载必须要的软件和Dockersudo apt-get install openssh-server vim net-tools openssh-server vim git curl samba samba-common python3 python3-pip git-lfscurl -sSL https://get.daocloud.io/docker | sh
1.2 配置gitgit config --global user.name "yourname"git config --global user.email "your-email-address"git config --global credential.helper store
1.3 装repocurl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/local/bin/repo chmod a+x /usr/local/bin/repopip3 install -i https://repo.huaweicloud.com/repository/pypi/simple requests
1.4 下载代码repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verifyrepo sync -crepo forall -c 'git lfs pull'
2.编译2.1 下载docker镜像并运行编译代码sudo docker pull swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard:0.0.1sudo docker run -it -v $(pwd):/home/openharmony swr.cn-south-1.myhuaweicloud.com/openharmony-docker/openharmony-docker-standard:0.0.1
在源码的根目录执行预处理脚本
../scripts/prepare.sh
编译代码
./build.sh --product-name Hi3516DV300
编译所生成的文件都归档在out/ohos-arm-release/目录下,结果镜像输出在 out/ohos-arm-release/packages/phone/images/ 目录下。
2.2 使用samba方便写代码mm@mm-virtual-machine:~$ sudo vim /etc/samba/smb.conf ## 在最后面添加 [work] comment = samba home directory path = /home/mm/ public = yes browseable = yes public = yes writeable = yes read only = no valid users = mm create mask = 0777 directory mask = 0777 #force user = nobody #force group = nogroup available = yes mm@mm-virtual-machine:~$ sudo smbpasswd -a mm ## 设置密码 mm是名字mm@mm-virtual-machine:~$ sudo service smbd restart ## 重启
3.烧录3.1 烧录前的准备烧录之前需要设置root,如果设置过了就不需要设置了
setenv bootcmd "mmc read 0x0 0x80000000 0x800 0x4800; go 0x80000000";
setenv bootargs "console=ttyAMA0,115200n8 root=emmc fstype=vfat rootaddr=10M rootsize=20M rw";
saveenvreset
3.2 开始烧录打开HITOOL,选择EMMC,然后选择之前编译出来的XML文件,点击烧录开始烧录