Clearing an app's *cache* and not the app's *data* via pm (or other CLI utility)?
2
votes
1
answer
1464
views
I'm running Android 13 in a rooted environment, and I want to use
pm
or some other Android command-line utility to clear an app's cache. If I do pm clear package.name
, it clears the app's data, and that's not what I want ... I only want cache clearing with the app's data remaining intact.
This needs to be a command-line utility, because I want to run it within a Tasker task. It could also be a shell script that runs multiple CLI commands.
I know that I can do pm trim-caches [... args ...]
to clear all caches of all apps, but that's not what I want, either. I want to clear the cache of one and only one app at a time.
Thank you in advance for any suggestions.
Asked by HippoMan
(955 rep)
Nov 12, 2023, 06:44 PM
Last activity: Nov 12, 2023, 06:53 PM
Last activity: Nov 12, 2023, 06:53 PM