自动刷抖音脚本

平时吃东西,或者洗衣服的时候想看抖音,又无法自动播放下一个,针对这种情况,我写了一个自动刷抖音的脚本,采用monkeyrunner实现的。

from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice
device = MonkeyRunner.waitForConnection()#获取连接的设备
device.wake()#唤醒屏幕
MonkeyRunner.sleep(1)
device.drag((400,500),(400,100),0.1,10)#上划解锁
MonkeyRunner.sleep(1)
device.startActivity(component='com.ss.android.ugc.aweme/.main.MainActivity')#打开抖音app
MonkeyRunner.sleep(1)
print("connected")
#无限循环每隔10秒自动刷下一个视频
while True:
	device.drag((400,500),(400,100),0.1,10)
	MonkeyRunner.sleep(10)
	print("again")
	pass

 

你可能感兴趣的:(python,移动开发,Android)