adb 常用命令总结 (补)

手势操作命令

这里要首先要开启坐标,才能看到 x,y轴

设置-开发者选项--输入---指针位置

逍遥模拟器 还需要在 窗口设定--显示坐标

模拟点击事件

adb shell input  tap  x,y    # x,y 是坐标点

案列:
adb shell input tap  393 191

模拟滑屏事件

adb shell  input swipe  startx,starty,endx,endy 

# startx,starty   是起始点         endx,endy 终止点

案列:
adb shell input swipe  125 1100   125    300

模拟键盘操作

adb shell input  keyenvent 键值 

# HOME键:3  
# 返回键:4
# 回车键:  66

# 案列:
adb shell input keyevent 3

adb shell input keyevent 4

模拟输入操作

adb  shell input text  文本

# 输入的内容不能是中文,焦点要先在输入框,才有效

案列:
adb  shell input text  hello

adb  shell input text  你好  就没有效果
原文地址:https://www.cnblogs.com/yimeng123/p/15320601.html