smileyborg
smileyborg

Reputation: 30469

Does the system kill a backgrounded/in-memory app during the update process on iOS?

If a third party app is backgrounded on iOS (still in memory) and the user updates the app from the App Store, will the app be terminated before or during the installation process? Is there any way for a backgrounded app to remain in memory after being upgraded? Will the app always receive the application:didFinishLaunchingWithOptions: callback when opened after an update?

(My assumption is that the app is killed and completely removed from memory, given that the app's executable code has likely changed during the update.)

Upvotes: 2

Views: 607

Answers (1)

Anya Shenanigans
Anya Shenanigans

Reputation: 94654

It will be killed. Whether it is terminated before, during or after the update is irrelevant - you should have saved state when the received the applicationDidEnterBackground:. There is no way that an app could continue executing once it's underlying code has changed - structures may have changed, you could have rewritten the threading model so that it does everything completely differently.

You will have to save state and attempt to restore it if it is compatible; otherwise you should start from scratch. You should save the state in the applicationDidEnterBackground: call - you will probably not get an opportunity in the applicationWillTerminate: call, as it will probably not be called.

Upvotes: 7

Related Questions