Disable a device owner app from android terminal

北城余情 提交于 2019-12-02 08:59:29

问题


well, my problem is: I have an application which is set as the device owner of a device (my tablet in this case). I did it from the terminal in Ubuntu, connecting the tablet to my PC and executting this line in the adb shell:

dpm set-device-owner my.app.package/my.app.route.MyAdmin

So, I want to disable the device owner app without restoring the device, just executing a line similar to the last one. Me and my coworker have been researching for a long time and we've never found anything about this, so I would like to know if it is possible or not, and if it is, how to do that.

Thanks!


回答1:


You can use DevicePolicyManager.clearDeviceOwnerApp() from your device owner app.

However note that this method has been deprecated in Android Oreo, you can still use it on Oreo devices but it might be removed in future Android versions.




回答2:


you can use the following ADB shell command to remove device owner

adb shell dpm remove-active-admin com.example.app/.AdminReceiver

Disables an active admin, the admin must have declared android:testOnly in the application in its manifest. This will also remove device owner and profile owners



来源:https://stackoverflow.com/questions/48990479/disable-a-device-owner-app-from-android-terminal

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!