1.获取当前连接的所有设备名
adb devices
2.执行某设备的返回键
adb -s PBV5T16413004929 shell input keyevent 4
3.执行某设备的HOME键,/26电源键/187切换应用/
adb -s PBV5T16413004929 shell input keyevent 3
4.执行某设备的输入文本wz01
adb -s PBV5T16413004929 shell input text wz01
5.执行某设备的点击操作
adb -s PBV5T16413004929 shell input tap 130 1548
6.执行某设备的滑动操作时间1s
adb -s PBV5T16413004929 shell input swipe 340 865 370 302 1000
7.执行某设备的启动app
adb -s U8ENW18426003896 shell monkey -p com.baidu.BaiduMap -c android.intent.category.LAUNCHER 1
adb -s PBV5T16413004929 shell am start com.baidu.BaiduMap
adb -s PBV5T16413004929 shell am start com.lerst.fakeln/.ui.activity.MainActivity
App不同启动方式不同,在下面两种方式中找activity或包名需要测试
<1.adb -s U8ENW18426003896 shell monkey -p com.baidu.BaiduMap -c android.intent.category.LAUNCHER 1 ,//替换包名 2. adb shell dumpsys package 包名 ,3.//adb shell dumpsys activity activities | findstr "cmp=" ,//命令若不执行去掉|管道符,手动查找>
8.执行某设备的创建目录
adb -s PBV5T16413004929 shell mkdir /sdcard/BDrl
9.执行某设备的截图,%Y%m%d_%H%M_%w Y年m月d日H小时M分s秒w星期
adb -s PBV5T16413004929 shell screencap -p /sdcard/BDrl/wz01/wz01_$(date +%Y%m%d_%H%M_%w).png