使用ADB和Python结合生成的设备驱动脚本deviceDriver.py
发布时间
阅读量:
阅读量
#coding=utf8
'''
adb shell input关键命令如下:
输入文本信息:adb shell input text <string>
例如:input text hello
7. 按键操作:adb shell input keyevent [--longpress] <key code or name>
例如:input keyevent 1 或者 input keyevent KEYCODE_MENU
10. 点击操作:adb shell input tap <x> <y>
例如:input tap 100 200
13. 滑动操作:adb shell input swipe <x1> <y1> <x2> <y2>
例如:input swipe 0 0 100 100
16. 截屏:adb shell screencap <filename>
例如:adb shell screencap /sdcard/screen.png
'''
#用于获取设备临时文件存放目录
import tempfile
#调用系统命令
全部评论 (0)
还没有任何评论哟~
