5

OpenHarmony-RK3568开发板操作流程

 2 years ago
source link: https://ost.51cto.com/posts/11053
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

OpenHarmony-RK3568开发板操作流程

一、获取源码

下载主干代码

repo init -u https://gitee.com/openharmony/manifest.git -b master --no-repo-verify --depth=10

repo sync -c --no-tag -j16
repo forall -c 'git lfs pull'

代码下载后初次编译需要做一些前期准备工作:主要有依赖工具安装、预编译(默认已经搭建好编译环境)

1. 在源码根目录下执行,安装编译器及二进制工具

./build/prebuilts_download.sh

2. 版本编译

./build.sh --product-name rk3568 --ccache

3. daily构建版本或转测版本获取

http://ci.openharmony.cn/dailybuilds
OpenHarmony-RK3568开发板操作流程-OpenHarmony技术社区

4. 转测版本

https://gitee.com/openharmony-sig/oh-inner-release-management/blob/master/Release-Testing-Version.md

OpenHarmony-RK3568开发板操作流程-OpenHarmony技术社区

1. 烧写所需驱动和工具获取

2. usb驱动安装

双击windows\DriverAssitant\DriverInstall.exe安装usb驱动

3. 正常烧写

双击\windows\RKDevTool.exe打开烧写工具,工具界面击烧写步骤如图所示:

OpenHarmony-RK3568开发板操作流程-OpenHarmony技术社区

MASKROM模式和LOADER模式两种模式下可供烧写,推荐LOADER模式烧写,非必要不使用MASKROM按键操作烧写。

LOADER模式烧写:板子上电状态,PC usb线连接板子,先按住板子上的Recovery键,然后按一下reset键,待工具界面显示LOADER设备后,松开Recovery键,设备进入loader模式,点击执行开始烧写,如图:

OpenHarmony-RK3568开发板操作流程-OpenHarmony技术社区

四、Hdc工具连接设备

1. hdc 自行编译源码根目录执行

./build.sh --product-name ohos-sdk --ccache

2. 直接copy到本地路径(可将hdc_std.exe改为hdc.exe方便点)加入环境变量,如图:

OpenHarmony-RK3568开发板操作流程-OpenHarmony技术社区

3. 测试HDC 以及常用命令

OpenHarmony-RK3568开发板操作流程-OpenHarmony技术社区

五、 测试套编译和执行

1. 测试套编译

命令行进入 /test/xts/acts 目录

编译单个子系统测试套

./build.sh product_name=rk3568 system_size=standard target_subsystem=startup
./build.sh product_name=rk3568 system_size=standard target_subsystem=××××

编译结果查看:/out/rk3568/suites/acts/

OpenHarmony-RK3568开发板操作流程-OpenHarmony技术社区

2. 执行测试用例

手动执行

将编译生成的可执行文件(c++用例等)和hap(js用例等),通过hdc 命令将文件复制到设备制定目录。通过 ./**

执行用例。

hdc list targets  //列出设备,类似于adb devices
hdc shell //类似于 adb shell
hdc target mount
hdc file send xxx(windows上文件的路径) xxx(push到设备端的路径) //push 文件
hdc file recv xxx(device要被pull文件的路径) xxx(windows下存放文件的路径) //从设备中导出文件
hdc smode //相当于adb root
hdc shell mount -o rw,remount /           //保证hdc可以send文件

自动执行

将编译生成的acts文件夹coay到Windows本地,cmd命令行进入acts目录,运行run.bat,然后执行run acts的方式开始执行用例,用例执行的报告和log会在acts目录下生成。

PS:运行run.bat依赖于编译生成的tools文件夹下的工具,tools文件夹如果为空,请检查编译工具是否安装全。

Q: tools文件夹为空,解决方法

OpenHarmony-RK3568开发板操作流程-OpenHarmony技术社区

执行find /usr/lib -name "libffi.so*"

然后做个软连接即可:
sudo ln -s /usr/lib/x86_64-linux-gnu/libffi.so.7 /usr/lib/x86_64-linux-gnu/libffi.so.6

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK