INNER CODE UNIT · Python
describe_device
cvet/fonline · BuildTools/android_device.py:73
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:
return ' '.join(parts)
return endpoint
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)