如何删除与有源设备管理的应用程序在Android上启用?设备管理、应用程序、Android

2023-09-05 05:54:27 作者:爱上你ゝ纯属意外

我写启用(DevicePolicyManager)和已安装的设备管理员的应用程序。 但是,当我想卸载它,它返回失败,此消息

I wrote an app with device admin enabled (DevicePolicyManager) and installed. But when I want to uninstall it, it returns failed with this message

WARN / PackageManager(69):如果不删除包com.mypackage.test:具有有源器件管理员

WARN/PackageManager(69): Not removing package com.mypackage.test: has active device admin

我怎样才能将其卸载,或卸载programmically它? 谢谢你。

How can I uninstall it, or uninstall it programmically? Thanks.

推荐答案

进入设置 - >位置与安全 - >设备管理器,然后取消选择要卸载的管理。

Go to SETTINGS->Location and Security-> Device Administrator and deselect the admin which you want to uninstall.

现在卸载应用程序。如果还是说,你需要禁用卸载应用程序之前,您可能需要在卸载之前强制停止应用程序。

Now uninstall the application. If it still says you need to deactivate the application before uninstalling, you may need to Force Stop the application before uninstalling.