繁体   English   中英

在Android Lollipop中不使用NFC的设备所有者

[英]Device Owner without using NFC in Android Lollipop

我想在不使用NFC的情况下使我的应用成为设备所有者。 在开发人员博客上,提到要成为设备所有者,您必须使用NFC,但我发现alex_au在此评论中提到,没有NFC也可以。

我已经尝试过了,但是没有成功。 有人能够做到这一点吗?

您可以从adb shell使用命令行工具dpm

用法:

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.

有关更多信息,请检查: dpm shell命令

注意:使用此命令之前,请确保未配置设备。 如果已配置设备,并且收到诸如“设备已配置”之类的消息,请在从设备中删除所有帐户后尝试命令,或在工厂重置设备后尝试。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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