views:

702

answers:

4

Say I have app version 1.0 released on the app store. Then I want to release version 1.1.

I will keep existing data that was copied out of the app bundle and into the app's sandbox. These are some XML config files and a sqlite db the user can write data to. These files could need updates that preserve their existing data.

What is the best way to test an upgrade scenario?

Is there any kind of delegate event that is only called on install?

Thanks.

+5  A: 

I think testing with AdHoc versions that is dragged dropped in iTunes is a similar upgrade situation.

That's how I tested upgrading our Chess game, so it keeps old and current games on the device.

As for the files/DB I suggest they should contain some version number.

epatel
I assume you run the upgrade checking code each time the app starts? Or is there a better way?
Dana Holt
Not really, haven't changed the "format" that much. I'm using NSDictionaries in plists and new versions only look for and use "new" entries and the code handles "missing" entries gracefully (thus) manage reading old data files.
epatel
I see. Thanks for the info.
Dana Holt
A: 

Hi,

Thanks for your post -- I'm trying to do exactly this.

However, what happens now is if I install (by dragging into iTunes) my v1.0, it installs fine. If I delete v1.0 from the device and iTunes, sync, and then drag v1.1's .app file over to iTunes, it installs v1.1 fine on my iPhone. But if I don't delete v1.0 first, when I drag v1.1 into iTunes it'll ask me if I want to replace it, and I say yes. All is good. They I sync, and it says it's upgrading my app, but then I get an error: "The application "myApp" was not installed on the iPhone "myIphone" because it could not be verified".

I don't get this error if I don't have v1.0 on my phone or in iTunes when I drag v1.1, so I'm thinking the v1.1 code sign is fine. The problem only happens when I try to upgrade.

epatel: can you detail exactly how you test the upgrade before you submit it to the app store?

Thanks!

I only test with AdHoc versions as you can't really run a binary signed for the appstore. When you get the "can not be verified error" I think you might have a signing problem.
epatel
A: 

Thanks for the response, but I'm not sure it is a signing error because v1.0 installs fine, and so does v1.1 -- is there a separate signing process for doing upgrades that is different from doing a build that works if there was no previous version?

I tested just now. I had a working AdHoc version on my none-dev machine iPhone. Increased the Bundle Version, and installed through iTunes. Worked fine. Old data and config was present without any signing problem. I do have a in-program way to verify version and could verify it really was the new binary running. So, I'm sorry if I can't help you.
epatel
A: 

Turns out I was only testing ad-hoc upgrades using iTunes on Windows, even though it was on multiple machines. No combination of OS versions or iTunes version (from 8.1 to 8.2 b10) worked -- they all installed an app fine if there was no previous version, but all attempts at upgrading resulted in the "application could not be verified" error.

However, I switched and tested the same devices on a Mac running iTunes 8.2 b10 and it worked the first time, for both devices.

This seems to be an error with iTunes on Windows platforms -- I've filed a bug with Apple.