INNER CODE UNIT · Python
log_install_failed_user_restricted
cvet/fonline · BuildTools/android_device.py:82
def log_install_failed_user_restricted(adb_path: str, endpoint: str) -> None:
device_name = describe_device(adb_path, endpoint)
log(f'Install blocked by device policy on {device_name}')
print('The APK push reached the device, but Android canceled the installation on the device side.', flush=True)
print('What to do on the device:', flush=True)
print(' 1. Unlock the screen and keep the device awake.', flush=True)
print(' 2. Confirm any installation or security prompt shown by wireless debugging or Package Installer.', flush=True)
print(' 3. If this is Xiaomi/MIUI/HyperOS, enable Developer options -> Install via USB and USB debugging (Security settings).', flush=True)
print(' 4. If Android warns about wireless debugging or unknown app install, explicitly allow it and rerun the install task.', flush=True)
print(' 5. If the app was canceled once, rerun the same task after confirming the device-side prompt.', flush=True)
def state_file_path(workspace_root: Path) -> Path:
return workspace_root / 'android-debug' / 'device-endpoint.txt'
def read_saved_endpoint(workspace_root: Path) -> str:
state_file = state_file_path(workspace_root)