电脑需要安装adb.exe。原理:使用uiautomator模拟手动操作手机。
import uiautomator2 as d
import time
import threading
import os
import random
# 支持多个手机同时执行上滑操作刷视频
class myThread(threading.Thread):
def __init__(self, did):
threading.Thread.__init__(self)
self.did = did
def run(self):
kuaishou(self.did)
def kuaishou(did):
#通过usb连接
a=d.connect_usb(did)
# 打开快手
a.app_start('com.kuaishou.nebula')
a.implicitly_wait(10)
#a.press(91)
while i<50: 164="" a.app_stop="" a.swipe="" a="os.popen(" adb="" b="a.read()" click="" com.example.hello_world="" devices="" didlist="[]" for="" i="" if="" in="" input="" keyevent="" len="" list="" n="" os.popen="" random.random="" range="" shell="" text="开宝箱" time.sleep="" waittime="">5:
tem = list[i].split('\t')[0]
thread = myThread(tem)
thread.start()
for i in didList:
thread = myThread(i)
thread.start()
50:>
for i in didList:
thread = myThread(i)
thread.start()
Comments
Post a Comment