简体   繁体   English

Android L“未启用设备配置”?

[英]Android L “Device provisioning is not enabled”?

I am trying out Android L's new profile manager. 我正在试用Android L的新配置文件管理器。 https://github.com/googlesamples/android-BasicManagedProfile https://github.com/googlesamples/android-BasicManagedProfile

When I deploy the apk, the package manager is not able to resolve the intent for device provisioning hence, I am getting "Device provisioning is not enabled. Stopping." 当我部署apk时,程序包管理器无法解决设备供应的意图,因此,我得到“设备供应未启用。正在停止”。

I have the latest Android L device image, that I got from http://developer.android.com/preview/index.html#download 我有从http://developer.android.com/preview/index.html#download获得的最新Android L设备映像

How can I enable device provisioning so that I can run the sample code. 如何启用设备配置,以便可以运行示例代码。

Your application should be device owner. 您的应用程序应该是设备所有者。

How to be device owner : 如何成为设备拥有者:

create a file device_owner.xml with following content 使用以下内容创建文件device_owner.xml

 <?xml version='1.0' encoding='utf-8' standalone='yes' ?> 
 <device-owner package="com.yourapp.packagename" name="*YouProductName" />

Now do the following steps 现在执行以下步骤

> adb push device_owner.xml /sdcard/
> adb shell
> su
> cp /sdcard/device_owner.xml /data/system/
> cd /data/system/
> chown system:system device_owner.xml
> reboot

Note : Before rebooting device, make sure that you installed the application, which you are trying to make device owner. 注意: 重新启动设备之前,请确保已安装要成为设备所有者的应用程序。 If you will not do, you will get boot animation for infinite time. 如果您不这样做,则将无限期获得启动动画。


Now you can check your sample application. 现在,您可以检查示例应用程序。 It will work. 它会工作。

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

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