ADB+Python+CMD实现读书软件的自动翻页
2018-01-26 10:15
337 查看
最近好冷,用手机看电子书,手好冻,干脆写了个简单的python通过ADB命令来实现自动翻页(有些app没有自动翻页功能)。
1、安装手机驱动和ADB软件;
2、python环境变量配置;
3、windows系统下cmd窗口执行python脚本。
具体脚本如下:
# -*- coding: utf-8 -*-
# 通过ADB命令实现自动翻页阅读
import os
import sys
import time
import math
import random
flag = 1
# 计数
numCount = 0
# 实现点击操作
CMD = 'adb shell input tap 1000 1000'
# 实现右滑操作
CMD_ToRight = 'adb shell input swipe 200 1620 1000 1620'
# 实现左滑操作
CMD_ToLeft = 'adb shell input swipe 1000 1620 200 1620'
while(flag != 0):
numCount += 1
time.sleep(random.uniform(15, 20))
print('阅读',numCount,'页')
os.system(CMD_ToLeft)EOF
1、安装手机驱动和ADB软件;
2、python环境变量配置;
3、windows系统下cmd窗口执行python脚本。
具体脚本如下:
# -*- coding: utf-8 -*-
# 通过ADB命令实现自动翻页阅读
import os
import sys
import time
import math
import random
flag = 1
# 计数
numCount = 0
# 实现点击操作
CMD = 'adb shell input tap 1000 1000'
# 实现右滑操作
CMD_ToRight = 'adb shell input swipe 200 1620 1000 1620'
# 实现左滑操作
CMD_ToLeft = 'adb shell input swipe 1000 1620 200 1620'
while(flag != 0):
numCount += 1
time.sleep(random.uniform(15, 20))
print('阅读',numCount,'页')
os.system(CMD_ToLeft)EOF
相关文章推荐
- 通过 python 打开 SecureCRT 软件并实现自动连接主机
- Python+ADB实现Android手机QQ自动点赞
- python实现模拟按键,自动翻页看u17漫画
- 使用Python实现博客上进行自动翻页
- python爬虫日志(13)selenium实现淘宝自动翻页以及在新的标签页中打开网页
- python自动12306抢票软件实现代码
- python实现模拟按键,自动翻页看u17漫画
- python实现自动输出文字小demo(cmd下)
- python实现自动重启本程序的方法
- Python-Requests模拟登录-实现图书馆座位自动预约
- Delphi 实现软件自动升级的功能
- Shell脚本实现自动检测修改最快的Ubuntu软件源
- 用C#实现C/S模式下软件自动在线升级
- Python实现系统时间自动校正
- Python Requests模拟登录实现图书馆座位自动预约
- Python编程使用tkinter模块实现计算器软件完整代码示例
- 在WinForm中使用Web Services 来实现 软件 自动升级( Auto Update ) (C#
- 系统软件自动部署实现方案
- ViewPager实现自动翻页功能 --转载出处找不到了,根据自己的理解写个随笔方便以后的记忆以及代码的共享,感谢给我启发的那位高手--第一次写博客哈
- Python_cmd的各种实现方法及优劣(subprocess.Popen, os.system和commands.getstatusoutput)