Files
aiData/Test/test02.py
HuangHai b66f683dfb 'commit'
2026-01-12 07:49:18 +08:00

9 lines
222 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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)