18.adb 模拟按键操作

发布时间 2023-12-16 19:43:40作者: 想要暴富的小男孩

adb 模拟手机按键

  • 1、打开【指针位置】设置
  • 2、执行 adb shell input 命令

模拟点击事件

adb shell tap x坐标 y坐标

模拟输入事件

adb shell input text <输入内容>

模拟滑动事件

adb shell swipe <起点x> <起点y> <终点x> <终点y> <滑动时长>

模拟手机按键

  • 返回键:adb shell input keyevent 4
  • Home 键:adb shell input keyevent 3(置应用于后台运行)
  • 音量放大:adb shell input keyevent 24
  • 音量缩小:adb shell input keyevent 25
  • https://developer.android.com/reference/android/view/KeyEvent