How Update does work for iPhone App? - iphone

I would like to know how updates work for the Apple store.
Does Apple delete all the old data related to the old version of the application and then update to the newer one?
When a user updates to a new version of any application, does the older version get deleted from their iPhone with all data ( pictures, database, sound,etc) and get replaced by the newer version or not?
I updated my application a few days ago, and I think that Apple does not replace the old SQLITE database with the newer one.

During update old application bundle is replaced by the new one. All other folders and so their contents in application sandbox (Documents, Library, tmp) remain untouched.
So if you want to replace old database (if you must save data changed by users in old database) you just need to check database version in your app and copy the new one from application bundle if version is old (you can use sqlite user_version pragma for version tracking)

Related

How do I update my app with a new build version?

I already have an app published on the app store but I have made changes and want to submit a newer version. How do I do this? Do I have to make a complete new app version and enter every detail again?
What about the data inside the app will people who used my app lose all the data on the app?
Hi and welcome to stackoverflow. To update an iOS app, you will need to re-use the exact same bundle ID as the previous version and increment / increase the version number. Same applies to subsequent builds submitted to App Store Connect.
1) In Xcode make sure to use the exact same bundle identifier (You can look it up on https://appstoreconnect.apple.com if you can't remember it)
2) Then set the Version to the new version. This does not need to be the exact same as on App Store Connect (which is the customer facing number), but I can only highly recommend using the same to not get confused.
2A) If you already have a build uploaded for the new version, you need to increment the build version as well. (i.e. if you have build 1.0.0, next one can be 1.0.1)
3) Create a new version of your app on App Store Connect. This can be done independently from your work in Xcode and you can even upload a new build even though there is no new version yet.
Any changes inside your build requires a new update for you app.
How do I do this?
First you have to add a new version in AppStore Connect. The only thing which is required is the text for the update i think, the rest is optional(Screenshots etc.).
After that you can upload a new version from Xcode (or Application Loader).
- increase the build number of your build target
- archive your app and upload it to AppStore Connect.
After a while your build is available in AppStore Connect and you can add it to your new version and send it to review.
What about the data inside the app will people who used my app lose all the data on the app?
Files in the documents directory will not be deleted if a user updates your app
Data in the UserDefaults will also not deleted
Files in the cache directory can be deleted every time

Data BACKUP on VERSION UPDATE. App Store

I am a little curious what happens in the situation when the user downloads a new version of application from App Store. I have an existing app, an eBook reader on the iTunes store (downloaded with customers).
Assuming that the customers have downloaded books to the existing version of application onto their iPad, now that a new version is available on app store & user downloads the same along with the app update i want the user downloaded books(on the previous version) to be backed up when a new updated version is installed.
Currently in my application i'm string these books in Caches Directory of Application Sandbox.
If there is a possibility of doing this, please provide some references?
A proper update will not remove the previous content of your sandboxed folders - hence I do not see a reason for a backup. Proper update means the user uses the iTunes update functionality.
Only once the user entirely removes the previous version and then installs the new version, the sandboxed files of the previous version will be gone.

Does iPhone app updation remove apps Data from iPhone

I wanted to know that if i have installed an application in my iPhone and it has a database attached with that which is saved into the particular app folder in iPhone. Now from my application i am updating the database with adding more records and filling up the database fields.
Now my app has a newer version available. I updated my iphone app. Now does it remove all the database records and create the a new empty database ?? or my all my app personal data will remain there as untouched when app has been updated to newer version.
please guide me friends
Thanks
Well that all depends, all the data in the app bundle will be replaced, If you placed your data in the document directory it will be unaffected.

Problem in updating app on iPad

I created an app for iOS 3.2 for the first version 1.0.
Recently I created an updated app for iOS 4.2 with print feature etc. for the second version.
My problem is that, the users are not able to update the app from appstore.
They are facing issues like data loss of version 1.0 app, crashing etc.
Can someone explain me what can be the reason for this?
And, how can I test this thing on my device, as I am not having the version 1.0 app from appstore, but the code for both versions.
Delete your new one on your test device and install the old one. Then build and debug the new one line by line. I had lots of trouble my first time through due to confusion over the update/migration process of core data. If you use core data, chances are your existing customers have an out of date store DB that your new code is crashing on. The store doesn't get wiped in an update if it's in your user's document directory... Only the one in the app bundle. You'll need to handle that reset or tell core data to migrate it to the new model. Of course, all this is speculation since you've given almost no details about the problem, frameworks used, log files, etc.
During a normal install process, data should not be overwritten. NSUserDefaults and files should remain during an upgrade, as long as the user doesn't delete the app first. I assume the crashing occurs after the new version is installed?

How the application upgrade works in iPhone

I am planning to post an application for iPhone in iTunes Store. Soon I am gonna provide an upgrade for it. But later to current version. I want to know how the upgrade system works in iPhone. Like does it replaces the whole application and reinstall it deleteing the previous database or it adds the new version keeping the database and all the same.
Upgrades replace the app bundle, but anything else in your sandbox (like the Documents folder, caches, preferences, etc) are preserved in place.