从android终端禁用设备所有者应用 [英] Disable a device owner app from android terminal

查看:234
本文介绍了从android终端禁用设备所有者应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好吧,我的问题是:我有一个应用程序,该应用程序设置为设备(在本例中为平板电脑)的设备所有者。我是从Ubuntu的终端上完成此操作的,将平板电脑连接到PC并在adb shell中执行了这一行:

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.

谢谢!

推荐答案

您可以使用 DevicePolicyManager.clearDeviceOwnerApp() 从设备所有者的应用程序中。

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

但是请注意,此方法已在Android Oreo中弃用,您仍然可以在Oreo设备上使用它,但可能已将其删除在未来的Android版本中。

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.

这篇关于从android终端禁用设备所有者应用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆