简体   繁体   中英

Device Owner without using NFC in Android Lollipop

I want to make my app as Device Owner without using NFC. On developer blog it's mentioned that to make device owner you must use NFC but I found it is also possible without NFC as mentioned by alex_au in this comment .

I have tried this but haven't been successful. Has anybody been able to accomplish this?

You can use command line tool dpm from adb shell.

Usage:

usage: dpm [subcommand] [options]
usage: dpm set-device-owner <COMPONENT>
usage: dpm set-profile-owner <COMPONENT> <USER_ID>

dpm set-device-owner: Sets the given component as active admin, and its package as device owner.
dpm set-profile-owner: Sets the given component as active admin and profile owner for an existing user.

For more information check: dpm shell command

Note: Before using this command make sure that device is not provisioned. If device is provisioned and you get message like "Device is already provisioned" try the command after removing all the accounts from device or try after factory resetting the device.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM