笔者去年就完成了ttyd这个的开源项目的OpenHarmony移植,但是去年只提供了二进制文件,最近才有时间整理出开源成果,老规矩,下面给出开源地址:

https://gitee.com/OpenHarmony_rk_equipment_transplantation/ttyd_openharmony

编译

git clone https://gitee.com/OpenHarmony_rk_equipment_transplantation/ttyd_openharmony.git

cd ttyd_openharmony/lycium/
# 设置oh交叉编译环境
export OHOS_SDK=/root/OpenHarmony/cix_myself_5.0.0/prebuilts/ohos-sdk/linux/12

# 编译依赖库
./build.sh openssl_1_0_2u
# 编译ttyd
./build.sh ttyd

部署运行

编译好的文件在ttyd_openharmony/lycium/usr/ttyd,将准备好的文件推送到开发板,执行./ttyd -p 7681 --writable -t disableResizeOverlay=true -w

image.png

然后使用web组件访问localhost:7681地址

image.png

具体实现请参考【开发者手机开箱】开源!OpenHarmony手机本地访问shell终端应用

Logo

社区规范:仅讨论OpenHarmony相关问题。

更多推荐