def devices(self) -> typing.List[typing.List[str]]: output = str(run_cmd(["adb", "devices"])) raw_device_list = [ # remove \r (#6) [each_str.replace("\r", "") for each_str in each.split("\t")] # split devices for each in output.split(os.linesep)[1:] # ignore empty line if each ] # [['123456E', 'device'], ['123456F', 'offline']] return raw_device_list
def start_server(self): return run_cmd(["adb", "start-server"])
def pull(self, device_path: str, pc_path: str) -> str: cmd = ["pull", device_path, pc_path] return run_cmd(self.build_no_shell_cmd(cmd))
def kill_server(self): return run_cmd(["adb", "kill-server"])
def push(self, pc_path: str, device_path: str) -> str: cmd = ["push", pc_path, device_path] return run_cmd(self.build_no_shell_cmd(cmd))