Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Android clean app cache on update?

In this document, Google says that:

When the user uninstalls your app, the system removes all your app's files from internal storage.

But does it clear app cache (or any other data inside internal storage) automatically when update app version (for example from v1.0 to v1.1)?

Because when I'm monitoring my company's app, the /cache folder goes down trend each time we release and users update to new app version.

I did a test on my phones and see that the app cache did decrease size. But I'm not sure all devices also be the same.

like image 821
nhoxbypass Avatar asked Jul 03 '18 07:07

nhoxbypass


People also ask

Should I clear cache after update Android?

For all Android devices that do still use the system cache for applying system updates, it's typically a good idea to wipe the system cache partition on your Android after a successful system update. This ensures that your system updates never use outdated files or data.

Can Android Clear cache automatically?

Tap Clear data to clear app data and cache. You'll then have to select whether you want to clear all data associated with the app or just its cache. Clearing data will automatically clear the cache of the app as well.

Does app cache clear itself?

No. Sometimes when it's required. Android cache cleaning is not necessary unless you're running out of storage space on your phone and you need to free up some.

Should you clear your app cache on Android?

Clearing your Android app cache can help fix speed issues and free up storage space. If you need more storage, clear the cache of the apps that take up the most space. Clearing your app cache every few months will help streamline your phone and keep it from getting too full.


1 Answers

Internal storage:

When the user uninstalls your app, the system removes all your app's files from internal storage.

External storage:

  • Public files: Files that should be freely available to other apps and to the user. When the user uninstalls your app, these files should remain available to the user.
  • Private files: Files that created using getExternalFilesDir() and rightfully belong to your app and will be deleted when the user uninstalls your app.

Yes, it clean data when user uninstalls, but NOT when user updates your app.

Note that some app does implement it's own cleaning mechanism by:

  • Catching android.intent.action.PACKAGE_REPLACED using BroadcastReceiver, then trigger clean some specific data.
  • Run a cron job to clean data after a time interval or when size of a folder reaches it's threshold/upper limit.

For detailed information, see this.

like image 84
Nha T. Tran Avatar answered Oct 19 '22 19:10

Nha T. Tran