Provisioner method fails with Device Admin error: check for existing accounts via ADB before provisioning
Android
If your device provisioning fails with a Device Admin or Device Owner error, the issue is likely due to existing accounts on the device. Android requires devices to be account-free before you can provision them with Esper using the provisioner method. This article explains how to check for and remove accounts so you can complete provisioning successfully.
Before you begin
You'll need:
- A computer with ADB (Android Debug Bridge) installed
- A USB cable to connect your device to the computer
- USB debugging enabled on your device
Step 1: Check for existing accounts using ADB
- Connect your device to your computer via USB.
- Open a terminal or command prompt on your computer.
- Run the following command:
adb shell dumpsys account - In the output, locate the
accounts:field. If it showsaccounts: 0, no accounts are present and you can proceed directly to provisioning your device with Esper. - If it shows
accounts: 1or higher, existing accounts are blocking provisioning. Continue to Step 2. - On your device, open Settings.
- Navigate to Accounts (the exact path may vary depending on your device manufacturer).
- For each account listed, select it and choose Remove Account.
- After removing all accounts, reconnect your device to your computer and re-run the ADB command to verify:
adb shell dumpsys account - Confirm the output shows
accounts: 0. - On your device, open Settings.
- Navigate to System or About Device (path varies by manufacturer).
- Select Reset or Factory Reset.
- Confirm the reset.
- Important: When the device restarts and prompts you to sign in, do not sign in to any account. Skip this step and proceed directly to Esper provisioning.
- Re-run the ADB command to verify:
adb shell dumpsys account - Confirm the output shows
accounts: 0. - Once you've confirmed
accounts: 0, begin the Esper provisioning process using the provisioner method. - After provisioning completes, verify that your device appears in the Esper Console under Devices & Groups with status Online and management state Managed.
- Reboot your device.
- Re-run the ADB command:
adb shell dumpsys account - If accounts have reappeared, remove them again or factory reset your device.
adb shell dumpsys accountadb shell dpm list-owners
Step 2: Remove existing accounts
You have two options to remove accounts from your device.
Option A: Manually remove accounts
Option B: Factory reset your device
Step 3: Retry provisioning
Troubleshooting
Accounts reappear after reboot
Some device manufacturers automatically re-register accounts on reboot. If this happens:
Provisioning still fails after removing accounts
Another MDM (Mobile Device Management) system may have already set a Device Owner on your device. Check using ADB:
adb shell dpm list-owners
If another Esper Agent is listed, you must remove it before Esper can be set as Device Owner. You may need to perform a factory reset to clear the previous Device Owner entry.
Unable to manually remove accounts or factory reset
If your device doesn't allow account removal or factory reset, it may have restrictions that prevent provisioning. Some device models or configurations may require special handling to support Esper management.
Still need help?
If you've followed these steps and provisioning still fails contact Esper Support and include the complete output from these ADB commands:
Please sign in to leave a comment.
Comments
0 comments