最新消息:觉得本站不错的话 记得收藏哦 博客内某些功能仅供测试 讨论群:135931704 快养不起小站了 各位有闲钱就打赏下把 My Email weicots#gmail.com Please replace # with @

安卓自动化咻一咻以及屏幕模拟点击 以实现自动化抢红包等。。

未分类 ajiang-tuzi 5091浏览

这部测试机是三星note 3 其他机型请自己 定位 x 和 y 轴
Screenshot_2016-02-05-00-45-58

工具
adb shell
手机必需打开usb 调试
cmd shell
声明 本脚本仅供学习和自动化测试 不得用于其他用途 否则后果自负

这是脚本

:adb shell input tap 349 710
:点击中心按钮
:adb shell input tap 140  347
:关闭弹出层
:ping 127.0.0.1 -n 5000>nul 
@echo WeiCot 自动化测试脚本
@echo www.wweicot.com
@echo 1050653098@qq.com
@echo ajiang-tuzi V0.12
:@echo off
@set var=100
@echo  开始循环  
:continue
@echo 第%var%次循环
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
adb shell input tap 349 710
ping 192.0.2.2 -n 1 -w 1000 > nul
set /a var-=1
if %var% gtr 0 goto continue
@echo 循环结束
@echo 循环执行完毕
pause
usage: input ...

       input text <string>
       input keyevent <key code number or name>
       input tap <x> <y>
       input swipe <x1> <y1> <x2> <y2>

使用方法是 放到adb目录下 另存为get.bat 点击运行就行
本来还有 视觉识别的脚本 由于那玩意 太大 还的提供足够的样本
不过 那个更智能化
效果

WeiCot 自动化测试脚本
www.wweicot.com
1050653098@qq.com
ajiang-tuzi V0.12
开始循环
第100次循环

E:\tools>adb shell input tap 349 710

E:\tools>ping 192.0.2.2 -n 1 -w 1000 1>nul

E:\tools>adb shell input tap 349 710

E:\tools>ping 192.0.2.2 -n 1 -w 1000 1>nul

E:\tools>adb shell input tap 349 710

E:\tools>ping 192.0.2.2 -n 1 -w 1000 1>nul

E:\tools>adb shell input tap 349 710
^C终止批处理操作吗(Y/N)?

转载请注明:(●--●) Hello.My Weicot » 安卓自动化咻一咻以及屏幕模拟点击 以实现自动化抢红包等。。

蜀ICP备15020253号-1