ADB Wifi failing to enable/disable app

308 views
Skip to first unread message

Soudane GMTA

unread,
Oct 10, 2023, 12:35:10 PM10/10/23
to Tasker
I'm running the latest Tasker beta on an Android 13 device.

I want to use ADB Wifi to enable and disable an app on my device. However, when I configure the enable-user and disable-user commands and then run one or the other one of them in Tasker, I get this error:

Error 1
Missing permissions ADB Wifi Access: Check notifications

However, there are no notifications.

And if I run the same underlying enable-user and disable-user commands via "Run Shell", I get the same error.

Are enable-user and disable-user inoperative in Tasker in Android 13, perhaps?

Or is there some permission that I can set which will allow these commands in Tasker?

Thank you very much in advance.

Matevz Leskovsek

unread,
Oct 10, 2023, 4:12:56 PM10/10/23
to tas...@googlegroups.com
You have to run this ADB command on USB cable on each boot of the device: adb tcpip 5555


In my experience a device can lose this permission also when battery is low. If someone has a hack to keep this permission more permanent that would be really cool

--
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/4a6f95c2-7457-4f2c-8c85-54f8415cf727n%40googlegroups.com.

Soudane GMTA

unread,
Oct 10, 2023, 9:27:05 PM10/10/23
to Tasker
Thank you very much!

Soudane GMTA

unread,
Oct 11, 2023, 10:30:00 AM10/11/23
to Tasker
I figured out another way to get around this issue.

The only reason I wanted to do this via "ADB Wifi" is because I was searching for a way to enable and disable apps via Tasker, and it's the only thing I came up with initially.

The "ADB Wifi" code enables and disables apps as follows:

pm enable-user --user 0 the.package.name
pm disable-user --user 0 the.package.name

It's these "enable-user" and "disable-user" commands which raise the permission errors.

But I then did more investigation, and I realized that I can simply run these commands as root to enable and disable an app:

pm enable the.package.name
pm disable the.package.name

This works without permission issues, and no cable connection to adb tcpip 5555 is necessary to set up any permissions.

So, I just created an EnableApp task and a DisableApp task which run those commands as root.

Matevz Leskovsek

unread,
Oct 13, 2023, 5:08:51 AM10/13/23
to tas...@googlegroups.com
Sure if you are rooted you dont need adb over wifi. Or did i miss a point?

Reply all
Reply to author
Forward
Message has been deleted
0 new messages