MCPcopy
hub / github.com/TencentQQGYLab/AppAgent / get_xml

Method get_xml

scripts/and_controller.py:118–130  ·  view source on GitHub ↗
(self, prefix, save_dir)

Source from the content-addressed store, hash-verified

116 return result
117
118 def get_xml(self, prefix, save_dir):
119 dump_command = f"adb -s {self.device} shell uiautomator dump " \
120 f"{os.path.join(self.xml_dir, prefix + '.xml').replace(self.backslash, '/')}"
121 pull_command = f"adb -s {self.device} pull " \
122 f"{os.path.join(self.xml_dir, prefix + '.xml').replace(self.backslash, '/')} " \
123 f"{os.path.join(save_dir, prefix + '.xml')}"
124 result = execute_adb(dump_command)
125 if result != "ERROR":
126 result = execute_adb(pull_command)
127 if result != "ERROR":
128 return os.path.join(save_dir, prefix + ".xml")
129 return result
130 return result
131
132 def back(self):
133 adb_command = f"adb -s {self.device} shell input keyevent KEYCODE_BACK"

Callers 3

task_executor.pyFile · 0.80
step_recorder.pyFile · 0.80
self_explorer.pyFile · 0.80

Calls 1

execute_adbFunction · 0.85

Tested by

no test coverage detected