简体   繁体   中英

Android L “Device provisioning is not enabled”?

I am trying out Android L's new profile manager. 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."

I have the latest Android L device image, that I got from http://developer.android.com/preview/index.html#download

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

 <?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.

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