Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android application life cycle when application is being updated by Play Store

I can't find information about app's process life cycle when application is being updated by Play Store.

For example when app's process is running and some Service does something and then update starts, I expect that after apk is successfully updated whole process is killed (where "old" app was running) and then process is started again (with "new" app launched).

Would this behavior differ for auto-updated app and manually updated app?

like image 371
Marian Paździoch Avatar asked Oct 09 '15 07:10

Marian Paździoch


1 Answers

I've just tested manually the case when you update the application via Play Market (real devices, Samsung tablet with Android 7.0, One Plus with Android version 8.0.0).

  • If the app is running in the foreground and you update it, the app is being killed. No restart. And when you start it over, the app is created from scratch.
  • If the app is running in the background - same behavior.

Also you can simulate app update by the command adb install -r yourApp.apk. As it's mentioned here and here.

I've noticed, when application is running and you reinstall the app with the adb command mentioned above, onDestroy is not called. App is not restarted. And when you start it over - it is created from scratch. Basically, same behavior as when I test manually with Play Market.

As a conclusion, when the app is being updated by Play Market, and it's running (background or foreground), it is simply killed by the system.

like image 138
Andrew Avatar answered Sep 22 '22 18:09

Andrew