INNER CODE UNIT · Python

run_capture

cvet/fonline · BuildTools/android_device.py:52

def run_capture(command: list[str], check: bool = True) -> str:
	result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, encoding='utf-8')
	output = result.stdout.strip()
	if check and result.returncode != 0:
		raise SystemExit(output or f'Command failed: {" ".join(command)}')
	return output


def run_capture_result(command: list[str]) -> tuple[int, str]:
	result = subprocess.run(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, text=True, encoding='utf-8')
	return result.returncode, result.stdout.strip()


def run_passthrough(command: list[str]) -> int:
	return subprocess.call(command)


def get_device_property(adb_path: str, endpoint: str, prop_name: str) -> str:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…