How to properly update your app?

Hello,

I’m quite new to Corona and I can say it’s a great tool. I managed to understand most of the api and how to work with it, but I didn’t find any information about how to release updates of your apps and how to do it.

I have 2 main questions regarding this:

  1. I noticed the “Version” field when you build your app for release. I first built a version 1.0. Then I made some changes and built as version 1.1. After uploading to iTunes and trying to sync with my phone, the updater bar under the icon from the phone got stuck and the app failed to update.

I’m not sure if this is the way to release updates, so please let me know how you guys do it.

  1. What files are being replaced after you release the update, and what’s the best way not to lose data from previous versions?

Thanks. [import]uid: 70003 topic_id: 26295 reply_id: 326295[/import]

On iTunes Connect, when you add a new version, you get to provide a version number. Apple does not enforce a standard numbering convention. I do Major.minor type releases. In other words, my OmniBlaster app, is now at version 1.8. So the 1 is the first main release and I’ve made 8 minor updates. You are on your own to come up with your own version numbering screen.

Now that iTunes Connect has a version number its expecting (which has to be greater than the last one that’s being updated), then when you build your Corona SDK app for distribution, make sure whatever you type in that version field matches what iTunes Connect is expecting.

Your App bundle is the only thing replaced during the update… in other words, the files in the system.ResourceDirectory folder (your lua files, your artwork and audio. Anything in that folder that holds your main.lua file).

Files created in system.DocumentsDirectory, files downloaded to system.CachesDirectory will remain (well at least as long as things remain in system.CachesDirectory). [import]uid: 19626 topic_id: 26295 reply_id: 106541[/import]

Thanks for the quick replay. It’s all clear now how to design the data not to lose it from version to version.

Just to make sure I understand clear the process, the only thing I actually have to do is to change the version on Corona build to match the version I provide on iTunes Connect right? (and use the same provisioning profile generated on iOS Provisioning Portal for the first release right?) [import]uid: 70003 topic_id: 26295 reply_id: 106600[/import]

Correct! [import]uid: 19626 topic_id: 26295 reply_id: 106619[/import]

So if I want to test locally on my device if the update version doesn’t mess up the data from the previous version, how do I do that?

As I said in the first post, I made an update to the app with a new version, uploaded to iTunes, but the app failed to update. I had to delete the app from my device and install it, but that removes all the local stored files.

Is this a bug, is this not possible or do I do something wrong? [import]uid: 70003 topic_id: 26295 reply_id: 106623[/import]

What I do is delete the previous app and upload new version. I’ve noticed that if I just upload new version while older is still on the phone sometimes older version remains on the phone and new version is not uploaded, so now I just delete and upload it again. Could have to do with that corona build process does not offer to remember the last version and it allways starts with 1.0 and I forget or mess that up, they should really help us here and track versions for us. [import]uid: 13099 topic_id: 26295 reply_id: 106646[/import]

Exactly. I only did some small scale tests to see how this works, so I’m sure I didn’t mess up the version, but I can confirm that the older version remains and it’s not updated on the phone.

Deleting the old version is not a good solution if you want to test if the new release has a design flow that will affect the users stored data from the previous version.

I only tested with iTunes. I don’t know if there’s the same problem when you release your app in the marketplace, which would be very bad (if you have to delete the app to get the updated version the users will lose all game progress and it’s more complicated). That’s why I think the problem is only on local releases, but as I said I only assume that.

Any details regarding this from more experienced users of Corona would be appreciated by starters I think. [import]uid: 70003 topic_id: 26295 reply_id: 106649[/import]

Lets look at this scenario:

You have 1.1 production on your device. You test 1.2 in the simulator and you now want to test on your device.

If you delete from your device, you loose your saved data in system.DocumentsDirectory, system.CachesDirectory, and system.TemporaryDirectory.

If you use XCode’s Organizer or iTunes to copy it over, you can replace the app with your new version. This preserves your data as it only replaces the system.ResourceDirectory bits.

Now you can put either a development or adhoc app on your device for testing. You have 1.2 now on your device.

Now you build 1.2 for distribution and upload it. iOS checks with the app store and sees that your 1.2 on your device has the same checksum as the one in the store, and your installed 1.2 stays. Your adHoc provision is good for a year.

If the version you upload to iTunes is a different version number, or the checksum is different then iTunes will prompt you to upgrade to the newest version.

Now I’m just guessing on the actual mechanics when I say “checksum”. I know that when I was just testing on my iPhone, I would NOT get prompted to update my app after I uploaded it to iTunes. When I released 1.8 of OmniBlaster, I had the latest test build on my iPad. The version of 1.8 on my iPhone was older. I got prompted to update them on my iPhone today. [import]uid: 19626 topic_id: 26295 reply_id: 106661[/import]

@robmiracle

“If you use XCode’s Organizer or iTunes to copy it over, you can replace the app with your new version. This preserves your data as it only replaces the system.ResourceDirectory bits.”

That’s the exact behavior that I was expecting, but the app fails to update to the new version. The loading bar gets stuck and then it says it failed to update.

I only tried with iTunes and only on one device (it is jailbroken but I don’t think it has anything to do with it). I will try on another device the first thing in the morning. [import]uid: 70003 topic_id: 26295 reply_id: 106666[/import]