INNER CODE UNIT · Python
command_install
cvet/fonline · BuildTools/android_device.py:299
def command_install(workspace_root: Path, apk_path: str, explicit_endpoint: str | None) -> int:
adb_path = resolve_adb_path(workspace_root)
endpoint = resolve_endpoint(adb_path, workspace_root, explicit_endpoint)
return_code, output = run_capture_result([adb_path, '-s', endpoint, 'install', '-r', apk_path])
if output:
print(output, flush=True)
if return_code != 0 and 'INSTALL_FAILED_USER_RESTRICTED' in output:
log_install_failed_user_restricted(adb_path, endpoint)
return return_code
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: