androidadbpinningdmp

error in activing set-device-owner using adb


i want to set device owner and active on my application using adb and dpm . i want to use startlocktask(). for creating kiosk application. but when i run this line in my commandline:

./adb shell dpm set-device-owner com.pakban.mobile.pinningtest/.AdminReceiver 

i recived an error like this :

Error: Bad admin: ComponentInfo{com.pakban.mobile.pinningtest/com.pakban.mobile.pinningtest.AdminReceiver}

thanks for your answers


Solution

  • in my case, i used tutorial on net like this link

    http://florent-dupont.blogspot.fr/2015/01/android-shell-command-dpm-device-policy.html

    at this time, non of example and tutorial not mentioned how to create device_admin xml file(or i couldn't find it). so you need create a folder under res with "xml" name. and then, you must create a xml file with "device_admin" name. in this xml file just add this tag:

    <device-admin>
    </device-admin>