做网站的主流软件海南建设厅网站资质查询
- 作者: 五速梦信息网
- 时间: 2026年04月18日 10:00
当前位置: 首页 > news >正文
做网站的主流软件,海南建设厅网站资质查询,四川住建厅信息查询系统,网站上的高清图怎么做通过adb shell sendevent 命令可以发送鼠标#xff08;触屏#xff09;、键盘等设备的事件#xff0c;写成bat脚本或sh脚本后可以方便地进行自动化测试。 命令格式#xff1a;adb shell getevent[device] adb shell sendevent [device] [type] [code] [value] 其中device为… 通过adb shell sendevent 命令可以发送鼠标触屏、键盘等设备的事件写成bat脚本或sh脚本后可以方便地进行自动化测试。 命令格式adb shell getevent[device] adb shell sendevent [device] [type] [code] [value] 其中device为设备类型不同的UE包括的device不一样可以通过下面的命令查看 adb shell cat /proc/bus/input/devices I: Bus0018 Vendor0000 Product0000 Version0000
N: Name88pm822_hook_vol
P: Phys88pm822_hook_vol/input0
S: Sysfs/devices/platform/pxa910-i2c.2/i2c-2⁄2-0030/88pm822-headset/input/input5
U: Uniq
H: Handlerskbd event5 keyreset touch_boost
B: PROP0
B: EV3
B: KEY4 0 0 0 c0000 0 0 0I: Bus0000 Vendor0000 Product0000 Version0000
N: Namevnc-ts
P: Physvnc-ts/input0
S: Sysfs/devices/platform/vnc-ts/input/input6
U: Uniq
H: Handlersmouse1 event6 touch_boost touch_boost
B: PROP0
B: EVb
B: KEY400 0 0 0 0 0 0 0 0 0 0
B: ABS11000003I: Bus0000 Vendor0000 Product0000 Version0000
N: Namemxt224_ts_input
P: Phys
S: Sysfs/devices/virtual/input/input0
U: Uniq
H: Handlersevent0
B: EV9
B: ABS2650000 0I: Bus0000 Vendor0000 Product0000 Version0000
N: Namegyro
P: Phys
S: Sysfs/devices/virtual/input/input1
U: Uniq
H: Handlersevent1
B: EV5
B: REL38I: Bus0000 Vendor0000 Product0000 Version0000
N: Nameherring-keypad
P: Phys
S: Sysfs/devices/virtual/input/input2
U: Uniq
H: Handlersevent2 keychord
B: EV3
B: KEY1c0000 0 0 0I: Bus0000 Vendor0000 Product0000 Version0000
N: Nameproximity
P: Phys
S: Sysfs/devices/virtual/input/input3
U: Uniq
H: Handlersevent3
B: EV9
B: ABS2000000I: Bus0000 Vendor0000 Product0000 Version0000
N: Namelightsensor-level
P: Phys
S: Sysfs/devices/virtual/input/input4
U: Uniq
H: Handlersevent4
B: EV9
B: ABS100 0I: Bus0018 Vendor0000 Product0000 Version0000
N: Namecompass
P: Phys
S: Sysfs/devices/virtual/input/input5
U: Uniq
H: Handlersevent5
B: EV5
B: REL3ff
获取上面的信息表示从event0~event5六个deviceHandles 设备名称 说明 HANDLER
mxt224_ts_input 屏幕触摸输入鼠标 event0
Gyro 陀螺仪 event1
herring-keypad 键盘 event2
proximity 近距离感应器 event3
lightsensor-level 光感应器 event4
compass 定位仪 event5
注意每台设备上的输入设备分布和名称都可能不一样
一般主要会用到鼠标
和
键盘
这里为event0和event2。 现在我们以鼠标事件举例 我们先用getevent查看event0的事件信息 adb shell getevent /dev/input/event0 然后在屏幕上点击或者滑动一下可以得到如下打印 0003 0035 0000008b
0003 0036 000002c0
0003 0030 00000044
0003 0032 00000004
0003 0039 00000000
0000 0002 00000000
0000 0000 00000000
0003 0035 0000008b
0003 0036 000002c0 这三组数字分别表示[type] [code] [value]与上面出现在adb shell sendevent [device] [type] [code] [value] 那么这些值表示什么意思呢我们可以查看event0的内容输入如下命令 adb shell getevent -p /dev/input/event0
看到如下信息 add device 1: /dev/input/event0
name: mxt224_ts_input
events:
SYN (0000): 0000 0003
ABS (0003): 0030 value 0, min 0, max 255, fuzz 0 flat 00032 value 0, min 0, max 30, fuzz 0 flat 00035 value 0, min 0, max 1023, fuzz 0 flat 00036 value 0, min 0, max 950, fuzz 0 flat 00039 value 0, min 0, max 4, fuzz 0 flat 0 这个依然有点晦涩大意为 type类型可能出现两种分别是 0000 代表 SYN0003 代表 ABS ABS type下的code 类型可能出现若干种包括 00300032003500360039 这五种code的意义可以参见 /frameworks/base/include/ui/EventHub.h #define ABS_MT_TOUCH_MAJOR 0x30 /* Major axis of touching ellipse /
#define ABS_MT_TOUCH_MINOR 0x31 / Minor axis (omit if circular) /
#define ABS_MT_WIDTH_MAJOR 0x32 / Major axis of approaching ellipse /
#define ABS_MT_WIDTH_MINOR 0x33 / Minor axis (omit if circular) /
#define ABS_MT_ORIENTATION 0x34 / Ellipse orientation /
#define ABS_MT_POSITION_X 0x35 / Center X ellipse position /
#define ABS_MT_POSITION_Y 0x36 / Center Y ellipse position /
#define ABS_MT_TOOL_TYPE 0x37 / Type of touching device (finger, pen, …) /
#define ABS_MT_BLOB_ID 0x38 / Group a set of packets as a blob /
#define ABS_MT_TRACKING_ID 0x39 / Unique ID of initiated contact /
#define ABS_MT_PRESSURE 0x3a / Pressure on contact area */可以参考android主页http://source.android.com/devices/tech/input/touch-devices.html 因此刚刚getevent获取到的内容大致可以做如下翻译
0003 0035 0000008b // x轴0x8b的位置
0003 0036 000002c0 // y轴0x2c0的位置
0003 0030 00000044 // 触摸椭圆的长轴为0x44
0003 0032 00000004 //
0003 0039 00000000 // Tracking ID为0
0000 0002 00000000 // SYN
0000 0000 00000000 // SYN
0003 0035 0000008b
0003 0036 000002c0
0003 0030 00000000 // 触摸椭圆的长轴为0表示离开屏幕了
0003 0032 00000001
0003 0039 00000000
0000 0002 00000000
0000 0000 00000000 PS:可以用下面的脚本获取event内容以及[type] [code] [value]值 echo off
set ADBadb -d wait-for-device
rem get the event number
::%ADB% root
::%ADB% remount
::%ADB% pull /proc/bus/input/devices
echo please press CTRLC to save
rem get the parameter
%ADB% shell getevent /dev/input/eventX out.txt
%ADB% shell getevent -p /dev/input/eventX event1.txt 了解了这些以后我们可以使用sendevent发送事件了 adb shell sendevent [device] [type] [code] [value] 注意的 [type] [code] [value]值我们使用getevent看到的都是16进制的sendevent的时候需要使用十进制的。 首先我们要获取到屏幕上的坐标值运行上面的脚本然后在屏幕上找个点按一下saveok在生成的out.txt中可以找到这个点的坐标值了如果按下的时间比较久可能会获取大一串16进制数. 知道了坐标值按照上面的举例我们可以写出在该点点击的命令了 rem 在10001538处点击
adb shell sendevent /dev/input/event1 3 53 1000
adb shell sendevent /dev/input/event1 3 54 1538
adb shell sendevent /dev/input/event1 0 0 0
adb shell sendevent /dev/input/event1 3 58 50
adb shell sendevent /dev/input/event1 0 0 0
adb shell sendevent /dev/input/event1 3 58 0
adb shell sendevent /dev/input/event1 0 0 0同理滑动的脚本 rem 从5401538点滑动到10001538点
echo off
set ADBadb -d wait-for-device
%ADB% shell sendevent /dev/input/event1 3 47 1
%ADB% shell sendevent /dev/input/event1 3 57 180
adb shell sendevent /dev/input/event1 3 53 540
adb shell sendevent /dev/input/event1 3 54 1538
adb shell sendevent /dev/input/event1 0 0 0
adb shell sendevent /dev/input/event1 3 58 50 //在5401538点按下
adb shell sendevent /dev/input/event1 0 0 0
adb shell sendevent /dev/input/event1 3 53 1000
adb shell sendevent /dev/input/event1 3 54 1538
adb shell sendevent /dev/input/event1 0 0 0
adb shell sendevent /dev/input/event1 3 58 50 //滑动到10001538点
adb shell sendevent /dev/input/event1 0 0 0
adb shell sendevent /dev/input/event1 3 58 0 //松开
adb shell sendevent /dev/input/event1 0 0 0
- 上一篇: 做网站的中文名字做网站需要服务器查询吗
- 下一篇: 做网站的资金来源o2o商城上的二级网站
相关文章
-
做网站的中文名字做网站需要服务器查询吗
做网站的中文名字做网站需要服务器查询吗
- 技术栈
- 2026年04月18日
-
做网站的中文名字公众号开发神器
做网站的中文名字公众号开发神器
- 技术栈
- 2026年04月18日
-
做网站的职位叫什么问题广告设计与制作app
做网站的职位叫什么问题广告设计与制作app
- 技术栈
- 2026年04月18日
-
做网站的资金来源o2o商城上的二级网站
做网站的资金来源o2o商城上的二级网站
- 技术栈
- 2026年04月18日
-
做网站的资料石家庄网络平台推广
做网站的资料石家庄网络平台推广
- 技术栈
- 2026年04月18日
-
做网站第三方wordpress 按钮样式
做网站第三方wordpress 按钮样式
- 技术栈
- 2026年04月18日
