鸿蒙4.0.0 安装minitouch

鸿蒙4.0.0 安装minitouch

ubuntu 系统

minitouch 地址 https://github.com/DeviceFarmer/minitouch

因为 鸿蒙4.0.0 对应安卓12 API版本31

所以启动 minitouch 需要 STFService

地址 https://github.com/openstf/STFService.apk

到release下载最新的STFService.apk

(或者自己源码编译,需要安装安卓studio )


adb install  STFService.apk

1安装成功后启动 server

  adb shell am start-foreground-service --user 0   -a jp.co.cyberagent.stf.ACTION_START     -n jp.co.cyberagent.stf/.Service

官方以下这条命令不对,别用

adb shell am startservice --user 0 \
    -a jp.co.cyberagent.stf.ACTION_START \
    -n jp.co.cyberagent.stf/.Service

会报错 Error: app is in background uid null

2 创建server端口转发

adb forward tcp:1100 localabstract:stfservice

本地端口1100连接

nc localhost 1100

3 新建终端 运行 agent

在新的终端 输入命令:

路径变量

APK=$(adb shell pm path jp.co.cyberagent.stf | \
    tr -d '\r' | awk -F: '{print $2}')

运行

adb shell export CLASSPATH="$APK"\; \
    exec app_process /system/bin jp.co.cyberagent.stf.Agent

4 创建agent 端口转发

新建终端输入命令:

adb forward tcp:1090 localabstract:stfagent

本地端口1090连接

nc localhost 1090

5 运行minitouch

新建终端
我已经提前安装好minitouch 到手机目录 /data/local/tmp/
输入 adb shell /data/local/tmp/minitouch
打印如下:

wmx:~$   adb shell /data/local/tmp/minitouch
open: Permission denied
Unable to open device /dev/input/event2 for inspectionopen: Permission denied
Unable to open device /dev/input/event0 for inspectionopen: Permission denied
Unable to open device /dev/input/event3 for inspectionopen: Permission denied
Unable to open device /dev/input/event1 for inspectionopen: Permission denied
Unable to open device /dev/input/event4 for inspectionopen: Permission denied
Unable to open device /dev/input/mouse0 for inspectionopen: Permission denied
Unable to open device /dev/input/mouse1 for inspectionopen: Permission denied
Unable to open device /dev/input/mice for inspectionopen: Permission denied
Unable to open device /dev/input/event6 for inspectionopen: Permission denied
Unable to open device /dev/input/event5 for inspectionopen: Permission denied
Unable to open device /dev/input/event7 for inspectionUnable to find a suitable touch device
using Android InputManager

新建终端创建minitouch 端口转发
必须使用步骤4 agent 端口 1090

adb forward tcp:1090 localabstract:minitouch
nc localhost 1090

显示

wmx:~$ nc localhost 1090
v 1
^ 10 1152 2376 0
$ 16385

上面显示的格式说明:
第一行
v <version>
version=1 是 协议版本

第二行
^ <max-contacts> <max-x> <max-y> <max-pressure>
<最大触摸数> <最大分辨率-x> <最大分辨率-y> <最大触摸压力>
10点触摸 / 1152 / 2376 / 0

第三行
$ <pid>
进程id是16385

运行命令测试

在手机 usb调试设置打开选项

-> 显示触摸操作
-> 指针位置

在步骤5命令 nc localhost 1090 创建的终端输入命令:

d 0 200 200 50 \n
c

看到效果

相关推荐

  1. 鸿蒙4.0.0 安装minitouch

    2024-02-05 07:44:01       124 阅读
  2. 404/400、Flask、WSGI

    2024-02-05 07:44:01       27 阅读
  3. Centos7 安装Jenkins2.440

    2024-02-05 07:44:01       54 阅读
  4. Windows + RTX4090驱动,CUDA安装

    2024-02-05 07:44:01       50 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-02-05 07:44:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-02-05 07:44:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-02-05 07:44:01       82 阅读
  4. Python语言-面向对象

    2024-02-05 07:44:01       91 阅读

热门阅读

  1. arm 汇编 dump buff data

    2024-02-05 07:44:01       49 阅读
  2. 前端工程化之:webpack3-1(css工程化概述)

    2024-02-05 07:44:01       51 阅读
  3. 鸿蒙 状态管理-应用存储

    2024-02-05 07:44:01       40 阅读
  4. Vue中跨域问题的解决

    2024-02-05 07:44:01       48 阅读
  5. Windows SDK(四)鼠标和键盘消息处理

    2024-02-05 07:44:01       39 阅读
  6. selenium之鼠标动作链

    2024-02-05 07:44:01       50 阅读
  7. 使用django构建一个多级评论功能

    2024-02-05 07:44:01       45 阅读
  8. 安装Debian 11 留档

    2024-02-05 07:44:01       62 阅读
  9. React和Vue实现路由懒加载

    2024-02-05 07:44:01       52 阅读