How to test an update process prior to release? - iphone

Is there a way to simulate the update of an app from Version 1 to 2?
I am not sure about what happens when I build & run an application in Xcode. I believe that when the app is already installed in the simulator, an update is happening just like it does when the user downloads a new version from the App Store. For example sqlite3 database files remain intact when I hit Bild & Run, while the binary of the app itself gets replaced.
So the question is: Is THIS already a safe way of testing update procedures? What are the alternatives PRIOR to releasing the app and getting dozens of bad reviews?

Unless you change a saved file, it remains as it was. If you really want to test this, then just install the current/old version on a test device. Then build the new version onto the same device. This has the same effect as an update through iTunes for the users.

If you have a separate test team that doesn't have access to the xcode project, they can still test updates using the xcode organizer:
Install the old version of the app on your device and use it a bit to simulate real user behaviour
Install your provisioning profile on the device
Open the xcode organizer and drag the new copy of your app onto the device
That'll keep the existing data intact, allowing you to test the new app with data from the old version.

Related

How to simulate the AppStore update process on device/simulator

We have submitted an update version of our existing applications in the App Store recently. But we have received a issue from one of the users, saying that the app is not functioning properly after the update. So in order to replicate the same, what are the steps to reproduce, so that i can analyse the issue?
Any help will be appreciated.
To simulate this before pushing yoru updated version to the AppStore you can:
Download the old version of your app from the appstore
Run the updated version of your app from XCode on the same device.
What will happen behind the scenes is that your app will be updated in a way similar to the Appstore. Your app will be partially updated while your doucments folder will stay the same. (what usually causes problems)
This solution is better because it lets you check for problems before and update was pushed to the Appstore.
Yeah, I get this a lot. The solution is a bit annoying, but you need to keep a history of IPAs you've submitted so you can put the on your phone through iTunes (so not the simulator) and then, run your code on your device putting a breakpoint on your applicationDidFinishLaunching handler in your app delegate, and start tracing from there. You should be able to find the old app store version in your organiser from the last time you submitted, or, go through your SVN/GIT history and checkout the version tagged to your release version.
Many times in the past that has happened to me where I test a new revision and everything looks fine but when I submit an update and is approved, users start complaining about a crash or lost data.
This is way I approach the problem.
(This is most important step) You need to either have your old code or old binary installed on your actual apple device. (Physical iPhone / iPad)
Now go to iTunes and install your new update.
Attach your physical iPhone / iPad to you computer, Launch Xcode and start debugging it.
NOTE: There have been many times when things work perfectly in the Simulator but break on the actual device. Its always important to test your code on the real thing as that is what the users are going to be on.
All that is required is to have the version of the app that is in the app store on your device, then install the updated version to your device. You can debug it using Xcode when you install the new version.

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 to get rid of old Localizable.strings?

So I have this app that is already on the app store. To get support for multi language localization we recently changed the localization configuration.
Old configuration:
./Localizable.strings
New Configuration:
./Swedish.lproj/General.strings
./Swedish.lproj/Localizable.strings
./Swedish.lproj/Settings.strings
If I remove the old version and install the new one everything works as expected, but if I leave the old version on the phone when I install the new one, the translations in ./Swedish.lproj/Localizable.strings won't be visible. So it seems to me like the old ./Localizable.strings is still left on the phone, hiding the new ./Swedish.lproj/Localizable.strings. The translations in ./Swedish.lproj/General.strings and ./Swedish.lproj/Settings.strings both works.
My fear is that if we release the update as is the users would be forced to uninstall the app before installing the update to get the translations to work, which would mean that they lose all their saved data. So you can see why this issue has high priority.
If I have understood the cause of the problem correctly, my question is how do I get rid of the ./Localizable.strings already present on the phone? The more general question would be how do I solve this problem?
Are you testing this in debug mode and Xcode is installing the new binary onto the device/simulator or are you doing an Adhoc build-and-archive and then test the update via itunes?
I know that xcode at times will not overwrite files when doing an build and run in debug mode. A touch of the file will not help, but only a clean-all, exit and restart of both Xcode and simulator cures it.
If you are using the adhoc build then the complete app bundle sould be overwritten. If this is not working something serious is at fault.

How can simulate the IPhone app upgrade process in the SDK simulator

I'm working on an iPhone app and about to release version 2. We'll be changing the core data model and I'd like to simulate the upgrade process in the simulator before releasing it to users and potentially causing data loss for them. There doesn't seem to be any real good doucumentation on how to do this in a sandbox before releasing it.
The process I've used in the past has been to wipe any working version from the Simulator, check out the previous version of my application from my repository, compile and install that, work with it for a bit, then compile and install the new version of the application. The installation of the new version should simulate the upgrade process, where you can test your data migration to your new model.
I also repeat this process on the device to make sure no problems are encountered there either.
there are some cases that cannot be simulated in Xcode. Look at this Apple page: https://developer.apple.com/library/ios/technotes/tn2285/_index.html
You have to create IPA file and simulate update via iTunes.
I agree with Brad's overall approach. To save a little time, I would just save the sample set of data that you create with the older version of your app. This way you won't have to keep recreating the sample data set if things don't go right. You will just simply copy the sample data set back into your app's directory in the Simulator.
Your app's directory is located at ~/Library/Application Support/iPhone Simulator/User/Applications/A GUID for your App on your development machine.

How to reinstall the iPhone app in ad hoc distribution

I am using ad hoc distribution for my iPhone app. It works very well. The only problem is when I update my app or create a new binary and want to install this new version on device, I need to delete the old version. Like although I drag and drop the new version in iTunes application, it does not over write the previous version even after I do sync. It might be becoz the app already exists in the device. So I need to delete it to reinstall it. How do I make sure the app gets updated to the new version and I dont loose the data from the previous app. Data I mean the database. Please note I am just formating the UI and not even touching the database.
I've found that you must increase the version number in your main plist file for iTunes to install a new version of your app.