from airtest.core.api import *
from airtest.core.android.minitouch import *
from airtest.core.android.base_touch import *
def switch():
init_device()
connect_device("Android:///b5978261?cap_method=javacap&touch_method=adb")
a_event = [DownEvent([49, 173]), SleepEvent(2), UpEvent(0)]
device().minitouch.perform(a_event)
def get_info():
os.system('adb shell getprop ro.product.model') # 手机型号
os.system('adb shell wm size') # 分辨率
os.system('adb shell getprop ro.build.version.release') # 版本
if __name__ == '__main__':
get_info()
switch()
