INNER CODE UNIT · Python

resolve_adb_path

cvet/fonline · BuildTools/android_device.py:35

def resolve_adb_path(workspace_root: Path) -> str:
	adb_name = 'adb.exe' if os_name_is_windows() else 'adb'
	workspace_adb = workspace_root / 'android-sdk' / 'platform-tools' / adb_name
	if workspace_adb.is_file():
		return str(workspace_adb)

	adb_path = shutil.which('adb')
	if adb_path:
		return adb_path

	raise SystemExit('adb not found; prepare Android workspace or install adb on the host')


def os_name_is_windows() -> bool:
	return sys.platform == 'win32'


def run_capture(command: list[str], check: bool = True) -> str:

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…