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

Method get_screenshot

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

Source from the content-addressed store, hash-verified

102 return 0, 0
103
104 def get_screenshot(self, prefix, save_dir):
105 cap_command = f"adb -s {self.device} shell screencap -p " \
106 f"{os.path.join(self.screenshot_dir, prefix + '.png').replace(self.backslash, '/')}"
107 pull_command = f"adb -s {self.device} pull " \
108 f"{os.path.join(self.screenshot_dir, prefix + '.png').replace(self.backslash, '/')} " \
109 f"{os.path.join(save_dir, prefix + '.png')}"
110 result = execute_adb(cap_command)
111 if result != "ERROR":
112 result = execute_adb(pull_command)
113 if result != "ERROR":
114 return os.path.join(save_dir, prefix + ".png")
115 return result
116 return result
117
118 def get_xml(self, prefix, save_dir):
119 dump_command = f"adb -s {self.device} shell uiautomator dump " \

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