Disable apps using Device Admin

chaoscreater

Active member
Hi,

There are a couple of devices that I own and/or manage and some are rooted, some are not. There are reasons why some of my devices are or are not rooted and I won't get into them. The issue is that on non-rooted devices, I can't easily automate disabling and enabling apps.

I'm well aware that you can disable apps via ADB, like this:
adb shell pm disable-user --user 0 <package_to_disable>

However, this requires you to run the command from a PC, which means you'd have to tether your phone to a PC for this. OR, you would have to run the ADB server on your phone (using Termux or whatever), so that you can run the ADB commands locally, without tethering to a PC. I'm well aware of these workarounds. The problem is that I can't always be using ADB for this and I won't get into the reasons why.

The alternative approach that I know of, is to use Device Admin. There are some apps that I've used in the past that utilizes Device Admin to unlock the ability to disable and enable apps, such as this one:

There are other apps that work similar to this and they all work well.

I've read somewhere in an old MacroDroid forum post that this is achievable with MacroDroid as Device Admin. It's simply a matter of removing accounts on your phone (you're not wiping or formatting anything) and then add MacroDroid as device admin, then run some ADB command, then adding your accounts back in.
 

Snurre

Well-known member
Hi,

There are a couple of devices that I own and/or manage and some are rooted, some are not. There are reasons why some of my devices are or are not rooted and I won't get into them. The issue is that on non-rooted devices, I can't easily automate disabling and enabling apps.

I'm well aware that you can disable apps via ADB, like this:


However, this requires you to run the command from a PC, which means you'd have to tether your phone to a PC for this. OR, you would have to run the ADB server on your phone (using Termux or whatever), so that you can run the ADB commands locally, without tethering to a PC. I'm well aware of these workarounds. The problem is that I can't always be using ADB for this and I won't get into the reasons why.

The alternative approach that I know of, is to use Device Admin. There are some apps that I've used in the past that utilizes Device Admin to unlock the ability to disable and enable apps, such as this one:

There are other apps that work similar to this and they all work well.

I've read somewhere in an old MacroDroid forum post that this is achievable with MacroDroid as Device Admin. It's simply a matter of removing accounts on your phone (you're not wiping or formatting anything) and then add MacroDroid as device admin, then run some ADB command, then adding your accounts back in.
I think your wrong here, MD can be set as admin without all that
I belive you mean device owner, which is another thing
 

chaoscreater

Active member
yeah sorry, I meant Device Owner.

However, the setup guide for App Freezer (the link I posted) also requires you to set it as Device Admin, then run ADB command to set it as Device Owner as well. So I think both is required.
 
Top