INNER CODE UNIT · Python

command_launch

cvet/fonline · BuildTools/android_device.py:310

def command_launch(workspace_root: Path, activity: str, explicit_endpoint: str | None) -> int:
	adb_path = resolve_adb_path(workspace_root)
	endpoint = resolve_endpoint(adb_path, workspace_root, explicit_endpoint)
	return run_passthrough([adb_path, '-s', endpoint, 'shell', 'am', 'start', '-n', activity])


def command_launch_game(workspace_root: Path, activity: str, explicit_endpoint: str | None, explicit_server_host: str | None) -> int:
	adb_path = resolve_adb_path(workspace_root)
	endpoint = resolve_endpoint(adb_path, workspace_root, explicit_endpoint)
	server_host = explicit_server_host.strip() if explicit_server_host else detect_host_ip_for_endpoint(endpoint)
	if not server_host:
		raise SystemExit('Android server host is empty')
	package_name = activity.split('/', 1)[0]

	log('Launching game with server host', server_host)
	run_passthrough([adb_path, '-s', endpoint, 'shell', 'am', 'force-stop', package_name])
	return run_passthrough([
		adb_path,

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…