Bulk switching device mode and clearing app cache at scale: Blueprint convergence + API approach
Android
This article explains how to switch multiple devices from Kiosk Mode to Multi-App Mode and clear app cache across your fleet at scale. You can use Blueprints for device mode changes and the Esper API for bulk cache clearing.
Before you begin
You'll need:
- Access to the Esper Console
- Your enterprise ID (found in Company Settings)
- An API token (generated in API Key Management) if using the API method
- The package name of the app whose cache you want to clear
How to bulk switch device mode using Blueprints
Use Blueprints to change all assigned devices from Kiosk Mode to Multi-App Mode at once.
- In the Esper Console, go to Blueprints.
- Find the Blueprint assigned to your target devices and click Edit Blueprint.
- Locate the Device Mode section and change it from Kiosk Mode to Multi-App Mode.
- Click Save.
- Click Publish to activate the updated Blueprint.
- Click Converge (or Apply to Devices) to push the configuration to all assigned devices.
- Go to Devices & Groups and verify that your devices now show Multi-App Mode as their active device mode.
Tip: This action affects all devices assigned to the Blueprint. If you only want to change some devices, move them to a separate Blueprint first.
Note: Offline devices will receive the mode change when they next check in. Devices must be online for immediate convergence.
How to bulk clear app cache using the API
Use the Esper REST API to clear app cache on multiple devices programmatically.
Step 1: Gather your API credentials
- In the Esper Console, go to Company Settings and note your enterprise ID.
- Go to API Key Management and copy your API token.
Step 2: Get your device IDs
Retrieve the list of device IDs you want to target:
GET https://<tenant>-api.esper.cloud/api/v0/enterprise/<enterprise_id>/devices/?limit=100
Replace <tenant> and <enterprise_id> with your actual values.
Step 3: Send the clear cache command
For each device, send a POST request using your HTTP client (Postman, curl, or a script):
POST https://<tenant>-api.esper.cloud/api/v0/enterprise/<enterprise_id>/devices/<device_id>/command/
Headers:
Authorization: Bearer <your_api_token>
Content-Type: application/json
Request body:
{
"command": "CLEAR_APP_DATA",
"command_args": {
"package_name": "com.example.yourapp"
},
"command_type": "DEVICE"
}
Replace <device_id> with each target device ID and com.example.yourapp with the actual package name.
Step 4: Verify the command
Check the status in the Esper Console by going to Devices & Groups → [Device Name] → Commands. A Success status confirms the cache was cleared.
Important notes about cache clearing
- The
CLEAR_APP_DATAcommand clears both app cache and app data (including user settings). Test on a non-production device first to confirm the behavior for your specific app and Android version. - Some OEM Android builds may restrict cache-clear commands. If the command fails, check the error details in the device's command history.
- Always test on a single device before running commands across your entire fleet.
Troubleshooting
Blueprint mode change didn't apply
- Verify that the device is online. Go to Devices & Groups and check the device status.
- Confirm the device is assigned to the correct Blueprint. Go to Devices & Groups → [Device Name] → Blueprint.
- Offline devices will receive the update when they check in.
API command returns an error (4xx status)
- Verify that your
enterprise_idanddevice_idvalues are correct. - Confirm that your API token has Device Management permissions.
- Check that all placeholder values (like
<tenant>) have been replaced with actual values.
Clear app data command fails on specific devices
- Some devices may not support this command due to OEM restrictions. Test on a single device first.
- Check the device's command history for error details.
Still need help?
If you need assistance with bulk operations, custom scripting, or have questions about your specific use case, contact Esper Support.
Please sign in to leave a comment.
Comments
0 comments