-- encoding=utf8 --
author = “bilibili”
from airtest.core.api import *
from poco.drivers.android.uiautomation import AndroidUiautomationPoco
poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
auto_setup(file)
#设置图像阈值匹配度
ST.THRESHOLD = 0.4
PKG = “tv.danmaku.bili”
APK = “iBiliPlayer-apinkRelease-6.0.0-b3608299.apk”
wake()
home()
if PKG not in device().list_app():
install(APK)
print(“app安装成功”)
stop_app(PKG)
start_app(PKG)
sleep(5)
图像匹配阈值,只要在程序的开头设置全局变量ST.THRESHOLD = 0.4,即可改变图像的阈值
阈值越低,图像匹配精确度越低,适配的手机个数越多