import uiautomator2 as u2
import threading
import os,time
d = u2.connect('')
def quan():
# time.sleep(3)
while True:
print(time.time())
try:
d(resourceId="com.kingroot.kinguser:id/button_right").click()
except:
pass
try:
d(resourceId="vivo:id/vivo_adb_install_ok_button").click()
except:
pass
try:
d(resourceId="android:id/button1").click()
except:
pass
print(d.info)
threading.Thread(target=quan).start()# 这里已经先启动多线程了,就是不执行
try:
os.system("adb uninstall " )
except:
pass
os.system("adb install -r " )# 多线程等待这个执行完才执行,不科学
d.app_start("")