Lines Matching refs:cmd
236 def check_shell(cmd, pattern=None, fetch=False): argument
237 cmd = f"{GP.hdc_head} {cmd}"
240 output = subprocess.check_output(cmd.split()).decode()
245 output = subprocess.check_output(cmd.split()).decode()
249 return subprocess.check_call(cmd.split()) == 0
253 cmd = f"shell md5sum {remote}"
255 return check_shell(cmd, local_md5)
260 cmd = f"shell bm {dump} -a"
261 return check_shell(cmd, bundle)
265 cmd = f"{GP.hdc_head} list targets"
267 return check_shell(cmd, GP.device_name)
273 cmd = f"file send {local_path} {remote_path}"
274 return check_shell(cmd) and _check_file(local_path, remote_path)
280 cmd = f"file recv {remote_path} {local_path}"
281 return check_shell(cmd) and _check_file(local_path, remote_path)
295 def check_hdc_cmd(cmd, pattern=None, **args): argument
296 if cmd.startswith("file"):
297 if not check_shell(cmd, "FileTransfer finish"):
299 if cmd.startswith("file send"):
300 local, remote = cmd.split()[-2:]
302 remote, local = cmd.split()[-2:]
305 elif cmd.startswith("install"):
307 opt = " ".join(cmd.split()[1:-1])
308 return check_shell(cmd, "successfully") and _check_app_installed(bundle, "s" in opt)
310 elif cmd.startswith("uninstall"):
311 bundle = cmd.split()[-1]
312 opt = " ".join(cmd.split()[1:-1])
313 return check_shell(cmd, "successfully") and not _check_app_installed(bundle, "s" in opt)
316 return check_shell(cmd, pattern, **args)