20

What is the official, documented behavior when you install an update to an app?

This question asks the same thing, but the answer, which says that the app bundle is replaced but all other folders are untouched, does not provide any documentation. I have reason to believe that the app bundle, in fact, is not replaced, so I'd like to know for sure.

Please link to documentation!

Community
  • 1
  • 1
Jesse Beder
  • 33,081
  • 21
  • 109
  • 146
  • As a followup on the question and answer. Middaparka's answer answers one part of the question - what files/data are preserved. I'm trying to figure out what delegate methods are called (if any) in the scenario like this: 1. We're on iOS 4.x with background processing ON 2. App goes to background (home button) - applicationWillResignActive: & applicationDidEnterBackground: are called 3. User opt to update from AppStore Is app killed? Is applicationWillTeminate: called? I guess (as the bundle is replaced) that app must be killed, right? – Pavel Kunc Jun 27 '11 at 16:19
  • @Pavel, see http://stackoverflow.com/questions/3139588/applicationwillterminate-in-ios-4-0 – Jesse Beder Jun 27 '11 at 23:30

1 Answers1

34

From the iOS Application Programming Guide (see the "Files Saved During Application Updates" section within "The File System"):

When a user downloads an application update, iTunes installs the update in a new application directory. It then moves the user’s data files from the old installation over to the new application directory before deleting the old installation. Files in the following directories are guaranteed to be preserved during the update process:

  • <Application_Home>/Documents
  • <Application_Home>/Library

Although files in other user directories may also be moved over, you should not rely on them being present after an update.

What you're seeing in the Why isn't my iPhone app bundle replacing the old one during an update? question is an issue where Xcode doesn't correctly detect/push updated resources to the device, which is a very different scenario.

Community
  • 1
  • 1
John Parker
  • 54,048
  • 11
  • 129
  • 129