1

I want to research the bloatware that I disabled using pm uninstall -k –user 0 <package> and I just realized that I don't know how to make a list of those specific apps. I can list the file names stored in /system/app but it would be very tedious to find which ones are disabled and also to figure out their package names. pm list has a -d option to display disabled apps, but it only works for apps disabled from within the android menu.

If it helps, the phone in mind is not rooted and it is running Android 6.0.1.

2 Answers 2

4
pm list packages -u

This lists all such 'uninstalled' packages in the system.

4
  • 1
    Note that pm list packages -u also includes installed packages (help says "also include uninstalled packages", so you need to diff it against pm list packages without the -u). Further, somewhere around Android 7, pm list packages was replaced by cmd package list.
    – Izzy
    Commented Jul 21, 2020 at 21:16
  • 4
    Like @Izzy said you need to diff both commands: diff <(adb shell pm list packages) <(adb shell pm list packages -u)
    – aLx13
    Commented Apr 23, 2021 at 10:09
  • Right, thanks for the diff command.
    – Jovylle
    Commented Nov 25, 2022 at 0:49
  • This should be put on the answer area.
    – Jovylle
    Commented Nov 25, 2022 at 0:50
1

I also encountered the same, what I did was export the list of packages to files and then automate the process of getting only all the uninstalled system packages using Python. Here is my Python script:

from pathlib import Path

downloads = Path("/storage/emulated/0/Download")
all_packages = downloads / "all_packages.txt"
debloated_system_packages = downloads / "debloated_system_packages.txt"
third_party_packages = downloads / "third_party_packages.txt"
bloatwares = downloads / "bloatwares.txt"9


def get_all_packages():
    with open(all_packages, "r") as f:
        all_packages_lines = f.readlines()
    return {line.strip() for line in all_packages_lines}


def get_debloated_system_packages():
    with open(debloated_system_packages, "r") as f:
        debloated_system_packages_lines = f.readlines()
    return {line.strip() for line in debloated_system_packages_lines}


def get_third_party_packages():
    with open(third_party_packages, "r") as f:
        third_party_packages_lines = f.readlines()
    return {line.strip() for line in third_party_packages_lines}


def get_bloatwares():
    with_bloatwares = get_all_packages() - get_third_party_packages()

    return with_bloatwares - get_debloated_system_packages()


def write_bloatwares():
    with open(bloatwares, "w") as f:
            for i in sorted(list(get_bloatwares())):
                f.write(i + "\n")
            

write_bloatwares()

Hint:

pm list packages -u > all_packages.txt
pm list packages -3 > third_party_packages.txt
pm list packages -s > debloated_system_packages.txt  # as the name suggests this gives all the current packages without those bloatwares that I uninstalled.

I used the Pydroid app to run the code and all the text files are saved on my downloads folder.

Obviously, it needs a little bit of coding, but I hope this will give some idea in the future if anyone would need it.

Note: I used the Package Manager app from F-Droid to uninstall those bloatwares, aShell You app also from F-Droid to run adb commands which both require Shizuku app to run properly. You can search on how to set it up. You don't need a PC for Android 11 and up.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .