9 lines
222 B
Python
9 lines
222 B
Python
import uiautomator2 as u2
|
||
|
||
d = u2.connect()
|
||
|
||
d.reset_uiautomator()
|
||
d.sleep(3)
|
||
xml = d.dump_hierarchy() # 导出当前UI结构(XML)
|
||
with open("ui_hierarchy5_2.xml", "w", encoding="utf-8") as f:
|
||
f.write(xml) |