0

I removed a package installed default via this command (with adb):

pm uninstall -k --user 0 the_package

Because of -k, the command does not remove the package's cache. How can I remove its cache after removing package's itself? I can't use the command again without the option because I have removed the package and now I do not have it.

2
  • You can try pm clear <package name>
    – Robert
    Commented Mar 9, 2022 at 19:48
  • Thank you. It is what I want. But can I get list of packages I have removed? Commented Mar 10, 2022 at 10:16

1 Answer 1

1

You should be able to uninstall the data directories of an already uninstalled app by executing:

pm clear <package name>

respectively on recent devices using cmd command

cmd package clear <package name>
cmd package clear --user 0 <package name>

This will delete all files (for the selected user) in /data/data/<package name>. Only the empty directory itself will remain and the app package name will not be removed from the list of uninstalled apps.

If you don't remember the correct package name you can list all packages including those uninstalled by the command

cmd package list package -u
3
  • How can I use cmd command? Should I install a new package for using this? I use debian. Commented Mar 11, 2022 at 11:28
  • @RezaHosseinzadeh No cmd is just the replacement for pm. It is only available on the Android device (so they are only available inside adb shell). If your device is too old and does not have the cmd command try the same arguments with pm. Most likely this will work, too.
    – Robert
    Commented Mar 11, 2022 at 11:50
  • Thank you. I found pm list packages -u command that lists removed packages to and used pm clear <package> command to clear their caches. Commented Mar 11, 2022 at 18:29

You must log in to answer this question.

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