Esempio n. 1
0
    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
Esempio n. 2
0
 def start_server(self):
     return run_cmd(["adb", "start-server"])
Esempio n. 3
0
 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))
Esempio n. 4
0
 def kill_server(self):
     return run_cmd(["adb", "kill-server"])
Esempio n. 5
0
 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))