'Clear Android APP's cache with command line

I'm trying to clear an app's cache using shell command, but I failed to completely clear it.

My understanding is that an app's cache are in the following folders:

    /data/data/<app package name>/cache
    /data/data/<app package name>/code_cache
    /data/user_de/<user id>/<app package name>/cache
    /data/user_de/<user id>/<app package name>/code_cache

So, I have issued "rm -rf {paths above}/*" one by one for these 4 folders. However, while the cache size is decreased as seen in android's native "App Info", it is not zero. I can only completely clear it by pressing "Clear Cache" in there.

I'm puzzled where else the extra cache locations could be? I checked there are files in /storage/emulated/0/Android/data// , but even "Clear Cache" does not remove these files.

Any ideas where are the other cache locations of an app?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source