Reputation: 130
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?
Upvotes: 2
Views: 2014
Reputation: 829
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.
Upvotes: 5