How to remove an app with active device admin enabled on Android?

shiami picture shiami · Mar 22, 2011 · Viewed 378.1k times · Source

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): Not removing package com.mypackage.test: has active device admin

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

Answer

Atmaram picture Atmaram · Mar 22, 2011

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.