Question

I need to change the bundle identifier of my iPhone app before I can upload it to the app store. However, I also have data in my Core Data store which want to continue using even after I change the bundle identifier. However, it seems that the bundle identifier is how the iPhone knows whether apps are identical with one another, so I end up with two distinct copies of the app -- with two distinct core data stores -- on my phone! I know that I can download the sqlite data store through the Xcode organizer, how can I make sure that my data transfers to the new app package with the new bundle identifier?

Was it helpful?

Solution

With some exceptions for OS4 every app (identified by it's BI) has it's own isolated storage on the phone. If you really have to change this (will also disable free updates for buyers of the "old version") you have to find an external migration way.

A lot of apps offer some kind of "backup" (on a PC / MAC or something else). What we did for a customer was to establish a website which allows "short time data storage". So that the old app could upload the data - and the new one loads it down. Of course this means updating your old app first for the "export".

But the idea "your app lives in it's own isolated world" also means that you have no access to the data of other apps. From the point of security this is imporant and good. For building "app suites" where the apps want to share data it's bad. But apples made enhancments for this in OS4 - which (I guess) won't help you in your case, since "sharing apps" must also be special designed.

OTHER TIPS

I know this question is very old, but I just noticed it while looking for the answer to the same problem and thought it still might be useful for others. The original poster half-answered his own question, but didn't quite take the next step.

If you have not yet released your app on the app store and you want to change your bundle identifier, it is possible to copy your CoreData store from one sandbox to another using the Xcode organizer as suggested above. Obviously, this is only useful for your own device (which I think is what the original poster wanted to do); this process won't allow data to be transferred on other users' devices if they've bought your app, so DON'T change your bundle identifier after your app has been released.

First, run the old app (the one with the old bundle identifier) on your device. In the Xcode organizer, select your device, then Applications, then select the app (with the old identifier) and download the data to your mac.

Then install the new app on your device (build and run it, then quit). In the Xcode organizer (and on the device itself) you should now be able to see two apps, one with each bundle identifier. Select the one with the new identifier, select upload and upload the data file you saved from the old sandbox. You should now have access to all your old data in the new app. Very handy if you don't want to recreate all the data.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top