admin 管理员组文章数量: 1087135
2024年3月10日发(作者:按什么键停止电脑运行)
y2 = size[1] * 0.75
for i in range(n):
if not args:
("adb shell input swipe %f %f %f %f %d" % (x1, y1, x2, y2, t))
else:
uid = args[0]
("adb -s %s shell input swipe %f %f %f %f %d" % (uid, x1, y1, x2, y2, t))
def swipe_left(*args, t=100, n=1):
"""Swipe device screen left in t milliseconds and repeat the operation n times"""
size = get_screen_size(*args)
x1 = size[0] * 0.95
y1 = size[1] * 0.5
x2 = size[0] * 0.05
y2 = size[1] * 0.5
for i in range(n):
if not args:
("adb shell input swipe %f %f %f %f %d" % (x1, y1, x2, y2, t))
else:
uid = args[0]
("adb -s %s shell input swipe %f %f %f %f %d" % (uid, x1, y1, x2, y2, t))
def swipe_right(*args, t=100, n=1):
"""Swipe device screen right in t milliseconds and repeat the operation n times"""
size = get_screen_size(*args)
x1 = size[0] * 0.05
y1 = size[1] * 0.5
x2 = size[0] * 0.95
y2 = size[1] * 0.5
for i in range(n):
if not args:
("adb shell input swipe %f %f %f %f %d" % (x1, y1, x2, y2, t))
else:
uid = args[0]
("adb -s %s shell input swipe %f %f %f %f %d" % (uid, x1, y1, x2, y2, t))
def swipe_oblique(*args, t=100, n=1):
"""Swipe device screen oblique in t milliseconds and repeat the operation n times"""
size = get_screen_size(*args)
x1 = size[0] * 0.05
y1 = size[1] * 0.75
x2 = size[0] * 0.95
y2 = size[1] * 0.25
for i in range(n):
if not args:
("adb shell input swipe %f %f %f %f %d" % (x1, y1, x2, y2, t))
else:
uid = args[0]
("adb -s %s shell input swipe %f %f %f %f %d" % (uid, x1, y1, x2, y2, t))
版权声明:本文标题:python模拟手机屏幕滑动_Python封装Swipe实现手机屏幕滑动操作 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://roclinux.cn/b/1710008504a553419.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论