簡體   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