我按照本教程将应用程序设置为设备所有者.在该教程中,有一节"使用adb设置设备所有者".这里的教程说明在安装Kiosk模式演示应用程序后,运行以下命令:
adb shell dpm set-device-owner sdg.example.kiosk_mode/.AdminReceiver
Run Code Online (Sandbox Code Playgroud)
这给了我错误:
adb server is out of date. killing...
* daemon started successfully *
java.lang.IllegalStateException: Not allowed to set the device owner because there are already several users on the device
at android.os.Parcel.readException(Parcel.java:1629)
at android.os.Parcel.readException(Parcel.java:1574)
at android.app.admin.IDevicePolicyManager$Stub$Proxy.setDeviceOwner(IDevicePolicyManager.java:5146)
at com.android.commands.dpm.Dpm.runSetDeviceOwner(Dpm.java:114)
at com.android.commands.dpm.Dpm.onRun(Dpm.java:82)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.dpm.Dpm.main(Dpm.java:38)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:257)
Run Code Online (Sandbox Code Playgroud)
我按照这个SO链接,Diego Plascencia Lara的答案帮助我摆脱了
adb server is out of date. killing...
* daemon started successfully *
Run Code Online (Sandbox Code Playgroud)
但运行adb shell dpm set-device-owner sdg.example.kiosk_mode/.AdminReceiver …