How to list uninstalled apps?

740 views
Skip to first unread message

Ricardo “Rudxain” Fernández Serrata

unread,
Feb 5, 2023, 11:31:06 AM2/5/23
to Automate
I've used `pm uninstall --user 0` on some apps to "debloat" my device.

The "Universal Android Debloater" uses ADB commands to get a list of uninstalled /system/ apps, but I've searched the source code and couldn't find it: https://github.com/0x192/universal-android-debloater

I want to do the same in AM, but the "App List" with flag "Installed" returns an empty array, so I can't use `except()` to get only the uninstalled packages.

Since my device has Android 12, uninstalled apps are hidden from Settings, unlike disabled apps

Henrik "The Developer" Lindqvist

unread,
Feb 6, 2023, 7:37:21 AM2/6/23
to Automate
I plan on including a way to match apps, in both App list and App pick blocks, by both flags that must be enabled and must be disabled, e.g. so it will be easier to exclude system apps.
I'm still pondering on how to best achieve this, i'm leaning for a solution with both "Flags" and "Flags mask" fields, that essential evaluate each app as (app.flags & mask) == flags

As for the "uninstalled" apps, the Android API is inconsistent as installed seems to have different meanings depending where used, currently the App list block use:
while the App pick:
I'd like to make both block support both "flags" somehow.

Ricardo “Rudxain” Fernández Serrata

unread,
Feb 8, 2023, 11:58:38 PM2/8/23
to Automate
Interesting. Thank you for the future feature!

Just now, I tried "manually" filtering packs, using "Is App Installed?", but I got an empty list. It seems

Ricardo “Rudxain” Fernández Serrata

unread,
Feb 9, 2023, 12:01:07 AM2/9/23
to Automate
(I accidentally sent the message) it seems "App Installed" and "App List" are similar

Ricardo “Rudxain” Fernández Serrata

unread,
Feb 21, 2023, 5:32:55 PM2/21/23
to Automate
I found a workaround algorithm:

all := shell_cmd("pm list packages -u").stdout
all := split(replaceAll(all, "package:"), "\n")
installed := shell_cmd("pm list packages").stdout
installed := split(replaceAll(installed, "package:"), "\n")
uninstalled := except(all, installed)

Reply all
Reply to author
Forward
0 new messages