How do you un-provision a device in order to set t

2020-04-14 12:13发布

'm trying to set up Device Owner using the sample apps downloadable from developer.android.com

https://developer.android.com/samples/NfcProvisioning/index.html https://developer.android.com/samples/DeviceOwner/index.html

But when I NFC tap the devices in the logcat for the device I am trying to set the Device Owner for I see this:

/? E/ManagedProvisioning﹕ Device already provisioned.

However I am doing a factory reset just before attempting the provisioning, so how can I get the device into an unprovisioned state?

2条回答
The star\"
2楼-- · 2020-04-14 12:49

I've seen different behaviours depending on models.

Usually removing all accounts from a device is enough, but it is not rare when you actually need to factory reset it.

In either case, don't setup any accounts on it. After factory reset, do the least you can on the device to enable USB debugging, install the app you want to enable DeviceOwner for - not through Play Store as you will need to setup an account.

adb shell dpm set-device-owner app.package/.DeviceAdminReceiver

查看更多
何必那么认真
3楼-- · 2020-04-14 13:02

You can set up a Device Owner using nfc or an activation code in Google account setup, three dot menu.

Either way, the setup wizard must not be completed before starting the DO setup. Perform the NFC beam while in setup wizard.

查看更多
登录 后发表回答