adb

adb shell input相关的操作有text、keyevent、tap、swipe、(press、roll轨迹球这两个操作已经无用)
分别对应输入文本、功能键、点击、滑动(长按)

1. 输入文本:
adb shell input text 12345
输入12345文本

2. 功能键:
adb shell input keyevent 4 返回
adb shell input keyevent 66 确定
adb shell input keyevent 67 删除;更多的keyevent键对应code值参考 http://www.cnblogs.com/chengchengla1990/p/4515108.html

3. 点击:
adb shell input tap 20 1000
点击位置(20,1000)

4. 滑动(长按)
adb shell input swipe 10 20 100 200
从(10,20)滑动到(100,200)
长按的技巧
最后加一个参数,表示操作的时间ms,如
adb shell input swipe 100 200 500 600 900 从(100,200)滑动到(500,600)总花费900ms
adb shell input swipe 1400 400 1400 400 900 长按(1400,400) 900ms

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值