viniciusfbb
viniciusfbb

Reputation: 681

What happens to local files when I update my app?

I have an application for iOS and Android, but I have never released any updates, that is, it is at version 1. I would like to know if when I release the update (version 2) what will happen with the local files of the app, in the following situations:

  1. An app local file that was not in version 1, was added in version 2 (Ex: an image that was added)
  2. An app local file in version 1, has been removed in version 2 (Ex: an image that has been removed, will it be deleted or will nothing happen to it?)
  3. An app local file contained in the version 1 package, has been changed in version 2 (Ex: an image that has been changed)
  4. An app local file contained in version 1 and 2 (exactly the same file), was changed by the app in version 1 at runtime, when it is updated to version 2, will it return to the original? (Ex: a database that existed in version 1, also exists in version 2, but since it was changed during use in version 1, will it be replaced by the database contained in version 2 or will it keep the changes from version 1?)
  5. An app local file contained in version 1, was changed at runtime by version 1, but it was also changed in version 2 (Ex: a database that existed in version 1 was changed at runtime by version 1, but it was redone in version 2)

@edit My app was made in Delphi (firemonkey)

Upvotes: 0

Views: 505

Answers (2)

viniciusfbb
viniciusfbb

Reputation: 681

My app was made in Delphi (firemonkey), I didn't mention it because I thought that replacing local files would be done by the AppStore and PlayStore in the update. But thanks to Paulw11 response, I was able to find out that it was Delphi himself who is responsible for this replacement, and contains a configurable property in each file called "Overwrite".

Upvotes: 0

Paulw11
Paulw11

Reputation: 114826

An app on iOS is distributed as a bundle (essentially a zip file). The bundle is read-only; it cannot be changed at runtime. When an app is upgraded on iOS the entire bundle is replaced.

An app can copy files from the bundle and save them to the read/write sandbox file system, but you need to write code to do this explicitly.

For your cases:

  1. The additional file will be in the bundle. If you want this file on local storage you need to copy it via code.
  2. The file will no longer be present in the bundle. Any local copy that was made by your previous version will remain.
  3. The updated file will be in the bundle. Any local copy that was made by your previous version will remain and won't be changed.
  4. The app cannot have made changes to files in the bundle, it can only have copied the file from the bundle to local storage before modifying it, so this is essentially case 3.
  5. Again this is basically case 3.

Things may be different on Android.

Upvotes: 2

Related Questions