Xiaomi (MIUI) provisioning fails with "Failed pushing device detail": pre-existing account blocks Esper enrollment
Android
If your Xiaomi (MIUI) device fails to enroll in Esper with a "Failed pushing device detail" error, a pre-existing account on the device may be blocking enrollment. This article walks you through identifying and removing accounts to complete provisioning successfully.
Before you begin
Device Owner provisioning in Android requires the device to be in a clean state with no user accounts. On certain Xiaomi devices—particularly those running Android 13—a Mi account or Google account may persist after a factory reset, preventing Esper from installing as Device Owner.
To resolve this, you'll need:
- A USB cable and a host machine (Windows, Mac, or Linux)
- USB Debugging enabled on your device
- ADB (Android Debug Bridge) installed on your host machine
Step 1: Check for existing accounts
- Connect your Xiaomi device to your host machine via USB.
- Enable USB Debugging on the device if not already enabled: Settings → About phone → tap Build Number seven times → Settings → Developer options → Enable USB Debugging
- Open a terminal or command prompt on your host machine.
- Run the following command to check for any accounts on the device:
adb shell dumpsys account - Review the output. If any account is listed—including Mi/Xiaomi accounts or Google accounts—it must be removed before enrollment can proceed.
Step 2: Remove accounts via device settings
- On your device, go to Settings → Accounts & Sync.
- Tap the account you identified in Step 1.
- Tap Remove Account and confirm.
- Repeat for any additional accounts listed.
If the account cannot be removed through the UI, proceed to Step 3.
Step 3: Remove accounts via ADB (if UI removal fails)
If the device UI does not allow account removal, try removing the account through ADB. Note that account removal methods vary by MIUI firmware version, so you may need to consult MIUI-specific documentation for your device's firmware build.
Common approaches include:
- Broadcast a login accounts changed action:
adb shell am broadcast -a android.accounts.LOGIN_ACCOUNTS_CHANGED_ACTION - Clear the account app data using the package manager (specific packages vary by MIUI version)
After running an account removal command, verify the account is removed by running the check command from Step 1 again.
Step 4: Factory reset and verify
- Factory reset your device: Settings → System → Reset → Erase all data (factory reset)
- After the reset completes and the device reboots, connect it to your host machine via USB again.
- Run the account check command again to verify no accounts are present:
adb shell dumpsys account - Confirm the output shows no accounts before proceeding to Esper provisioning.
Step 5: Configure Xiaomi developer settings
Before starting Esper enrollment, ensure the following Xiaomi-specific developer settings are enabled on your device:
- USB Debugging enabled
- Install via USB enabled
- MIUI Optimization disabled (if available)
- USB Debugging (Security settings) enabled (if available)
Once these settings are configured and all accounts are removed, proceed with Esper provisioning. Enrollment should now complete successfully.
If accounts persist after factory reset
If an account cannot be removed by any available method and reappears after a factory reset, the account may be baked into the device firmware by the carrier or reseller. In this case:
- Contact Xiaomi support with your device model and firmware version to request guidance on fully clearing accounts from MIUI.
- Consider swapping this device for another from your batch that does not have a persistent account.
Still need help?
If you've completed all steps above and enrollment still fails, or if you encounter a different error, contact Esper Support. Provide the output from adb shell dumpsys account and your device model and MIUI firmware version to help us assist you more quickly.
Please sign in to leave a comment.
Comments
0 comments