问题描述
试图使用可从developer.android.com下载的示例应用程序设置设备所有者.
'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
但是当我NFC在设备的日志猫中点击设备时,我正在尝试为它设置设备所有者,我看到的是:
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?
推荐答案
我看到了不同的行为,具体取决于模型.
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.
无论哪种情况,都不要在其上设置任何帐户.恢复出厂设置后,请至少在设备上启用USB调试,然后安装要启用DeviceOwner的应用-而不是通过Play商店安装,因为您需要设置帐户.
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
这篇关于如何取消设置设备以设置设备所有者?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!