查看uiautomator和atx-agent的运行状态

2022-04-06  本文已影响0人  测试探索
import uiautomator2 as u2
import time
d = u2.connect_wifi("10.0.202.79")
# print(d.info)
#查看uiautomator是否运行
# print(d.service("uiautomator").running())
#启动uiautomator服务
# d.service("uiautomator").start()
#停止uiautomator服务
# d.service("uiautomator").stop()
# print(d.service("uiautomator").running())
# 自己写的代码
# if d.service("uiautomator").running():
#     print("1")
#     time.sleep(5)
#     print("设备信息为:",d.info)
# else:
#     print("2")
#     time.sleep(5)
#     d.service("uiautomator").start()
#     time.sleep(5)
#     print("查看状态:",d.service("uiautomator").running())
#     print("启动后设备信息为:",d.info)

# 第二部分
# 查看atx-agent的运行状态,如果atx-agent停止了,可以通过connect_usb来唤醒atx-agent
print(d.agent_alive)

#查看设备的分辨率
print(d.window_size())

#查看获取到的wifi地址
print(d.wlan_ip)

#服务相关和信息获取
上一篇下一篇

猜你喜欢

热点阅读