Install Silent APK
Summary
- Internal name:
InstallSilentApk - Category: Device Admin (MDM)
- Purpose: Silently download and install an APK from a URL, with no user interaction, using Android Device Owner privileges.
- Task type: Normal
Compatibility
-
Minimum AndroMate version:
1.1.0 -
Maximum AndroMate version:
1.1.0 -
Minimum Android:
Android 13 (API 33) -
Maximum Android tested:
Android 16 (API 36) -
Supported manufacturers:
- ✅ All manufacturers
-
Required permissions:
- The AndroMate agent must be provisioned as Device Owner on the device — see the MDM / Device Owner provisioning documentation. Not a regular runtime permission; without Device Owner status, this task always fails.
Detailed description
The Install Silent APK task downloads an APK from apk_url and installs it without any user confirmation dialog — a capability only available to an app holding Android's Device Owner role (fully-managed device / MDM scenario).
This is one of the "MDM tasks" that require the AndroMate agent to be Device Owner: every task in this family shares the same guard, and fails immediately with DEVICE-OWNER-ERROR-001 if the agent isn't provisioned as Device Owner — before even reading apk_url.
The install itself is asynchronous on the Android side; the task blocks until it succeeds, fails, or 60 seconds pass.
Input parameters
| Parameter | Type | Required | Possible values | Android Compatibility | AndroMate Compatibility | Default |
|---|---|---|---|---|---|---|
apk_url |
String | Yes | A reachable HTTP(S) URL pointing to a valid .apk file |
Android 13 (API 33) → Android 16 (API 36) | 1.1.0 → 1.1.0 | "" |
Output parameters
The Install Silent APK task produces no outputs. On success, the package described by the downloaded APK is installed on the device.
Exceptions
| Code | Exception Name | Description |
|---|---|---|
DEVICE-OWNER-ERROR-001 |
Device Owner Required | The AndroMate agent is not provisioned as Device Owner on this device. |
DEVICE-OWNER-ERROR-002 |
Silent APK Installation Failed | The download or install step failed (bad URL, corrupt APK, signature mismatch, etc. — see the error message for details). |
| — | Timeout | The install did not complete within 60 seconds (fixed, not configurable). |
Execution flowchart
flowchart TD
Start([▶ InstallSilentApk]) --> CheckOwner{Agent is\nDevice Owner?}
CheckOwner -->|No| E1[❌ DEVICE-OWNER-ERROR-001\nDEVICE_OWNER_REQUIRED]
CheckOwner -->|Yes| Download[⬇️ Download APK from apk_url]
Download --> Install[📦 Install silently, no dialog]
Install --> Wait{Result within\n60s?}
Wait -->|No| E2[❌ Timeout]
Wait -->|Success| Success1[✅ Package installed]
Wait -->|Failure| E3[❌ DEVICE-OWNER-ERROR-002\nINSTALL_FAILED]
Success1 --> Success([✅ VoidResult])
E1 --> Error([❌ Exception])
E2 --> Error
E3 --> Error
style Start fill:#e3f2fd
style Success fill:#c8e6c9
style Error fill:#ffcdd2
style Install fill:#fff9c4
How it works:
- Device Owner check: raises
DEVICE-OWNER-ERROR-001immediately if the agent isn't Device Owner. - Download + install: downloads the APK from
apk_urland installs it silently (no user prompt). - Wait: blocks up to 60 seconds for the (asynchronous) install callback.
- Result: success installs the package; failure raises
DEVICE-OWNER-ERROR-002with the underlying error message; no callback within 60s raises a timeout.
Input parameter details
1. Input parameter: apk_url
The HTTP(S) URL to download the APK from.
Example
Details
- Must be reachable from the device and serve a valid
.apkfile. - Resolved at runtime — may reference a
$variable.