INNER CODE UNIT · Python

run_capture_result

cvet/fonline · BuildTools/android_device.py:60

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:
	return run_capture([adb_path, '-s', endpoint, 'shell', 'getprop', prop_name], check=False).strip()


def describe_device(adb_path: str, endpoint: str) -> str:
	manufacturer = get_device_property(adb_path, endpoint, 'ro.product.manufacturer')
	model = get_device_property(adb_path, endpoint, 'ro.product.model')
	parts = [part for part in [manufacturer, model] if part]
	if parts:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…