Device skips setup wizard after factory reset — grant Device Owner via ADB
Android
When a device boots directly to the home screen after a factory reset instead of launching the Android setup wizard, the Esper Agent cannot claim Device Owner privileges through the normal provisioning flow. You must grant Device Owner rights manually using ADB (Android Debug Bridge) before enrollment can complete.
Why this happens
Android only allows Device Owner to be set during the setup wizard, or before any user accounts are added to the device. If the setup wizard is suppressed — by a device manufacturer, carrier configuration, or OEM customization — the standard provisioning window is bypassed. ADB provides an alternative path to set Device Owner after boot, as long as no accounts exist on the device.
Before you begin
- The Esper Agent APK is available on your workstation
- ADB is installed on your workstation (
adb versionshould return 30 or higher) - The device has not had any Google accounts, local accounts, or work profiles added since the factory reset
Steps
-
Enable USB Debugging on the device.
Go to Settings → About Device and tap Build Number seven times to unlock Developer Options. Then go to Settings → Developer Options and enable USB Debugging. This allows ADB commands to reach the device over a USB or Wi-Fi connection. -
Connect the device to your workstation.
Attach the device using a USB cable. If USB is not available, pair over Wi-Fi instead: open a terminal and run
using the IP address, port, and pairing code shown on the device under Settings → Developer Options → Wireless Debugging. Your workstation and device must be on the same Wi-Fi network, and your ADB version must be 30 or higher.adb pair <ip>:<port> -
Verify ADB detects the device.
Run:
The device serial number must appear in the list with the statusadb devicesdevice. If it showsunauthorized, unlock the device and tap Allow on the USB Debugging prompt. If no device appears, try a different USB cable or port. On Windows, install the OEM USB drivers from the device manufacturer's website — generic ADB drivers may not work for all hardware. -
Install the Esper Agent if it is not already on the device.
Run:
Replaceadb install <path_to_esper_agent.apk><path_to_esper_agent.apk>with the full local path to the APK file. Skip this step if the Esper Agent is already installed. -
Grant Device Owner rights to the Esper Agent.
Run:
A successful response looks like:adb shell dpm set-device-owner com.shoonyaos.shoonyadpc/com.shoonyaos.shoonyadpc.receivers.AdminReceiverSuccess: Device owner set to package com.shoonyaos.shoonyadpc -
Resolve account conflicts if the command fails.
If the command returns:
Go to Settings → Accounts on the device and remove every account listed, including Google accounts, local accounts, and any work profiles. Re-run the command from Step 5.Not allowed to set the device owner because there are already some accounts on the device
If accounts cannot be removed through Settings, perform a clean factory reset and run this ADB workflow immediately after boot, before signing in to any account. -
Launch the Esper Agent and complete enrollment.
Open the Esper Agent on the device. Enrollment completes automatically once Device Owner is confirmed. In the Esper Console, go to Devices & Groups, locate the device, and confirm the assigned Blueprint and group configuration are applied.
Verify: The device should appear in Devices & Groups with a status of Online and the correct Blueprint applied within 5 minutes of completing enrollment. If the device shows as Inactive or does not appear at all, the Device Owner grant may not have taken effect — repeat from Step 5.
If this doesn't resolve it
If the set-device-owner command returns an error other than the accounts conflict described above — such as a component name mismatch or a message indicating Device Owner is already set — collect the following before contacting support:
- The exact error message returned by ADB
- Output of
adb devices - Output of
adb shell dpm list-owners - Device make, model, and Android version
- Esper Agent APK version installed on the device
Contact Esper Support with this information so the issue can be investigated further.
Still need help?
If the steps above don't resolve the issue, submit a support ticket with your device model, Android version, Esper Agent version, and a description of what you've already tried — this helps the support team investigate without a follow-up.
Please sign in to leave a comment.
Comments
0 comments