Any possibility of directory change when update app? - iphone

Recently, updated my app v1.0 to v1.0.1.
Then one of our tester said
'Lost all pictures that saved in app' (not photo library)
I found that installing the App with Xcode and updating the AppStore version on the device
will change the App's directory, so data will be lost. (But not all data. Some files are copied, in my case .db files. that's really odd)
ex)
/var/mobile/Applications/D108B86A-27A8-4665-A490-F1CBB94CE04A/Documents/
/var/mobile/Applications/CCCD0C25-C33E-498F-8D24-9AF243E01A21/Documents/
But it isn't normal process, maybe it causes problem.
Is there any possibility of directory change in normal process?(Install from appstore then update from appstore)
I wanna try 'Normal process' but there's no device that have old ver.
So can't make appear 'Update' button in appstore again :(

I found that updating app causes directory changed.
So should not save 'Full Path' at Database or file.

I had the same problem: ad-hoc version of app can't upgrade to appstore version. It just removes ad-hoc and installs app store. But during normal update process app store -> app store it replaces only app package so all should work OK.

Related

How to update an iPhone Application

I got an App on AppStore, but since I launched it on the store, I have made some changes. How do I update my App to appstore?
Thanks
Needless to say, i JUST wan't to rename my Application so that it shows a different name on the Home screen of the user
Go to itunesconnect.apple.com and login. Then you go on manage applications and choose your app to update. There you can prepare your app to the update with informations etc.
To Rename the app you have to look in the plist file. There is a row for the product name. This is the name that is displayed on the screen.
After this. Archive the App with the distribution provisoning file and submit mit through the organizer.
An update is pretty much the same process as the initial release. Make your changes and test on your device. When you are happy with it, build the release version and use the "Add Version" button in itunesconnect to upload the new version of the app.
In your plist you can change the "Bundle display name" key. If your bundle identifier remains the same this will just change the name of your app in springboard.
App update process is smilier to new release app but you have to remember two major things.
Change the version of your app in plist file
Add a new version of your app in ituneconnect with the same version no you entered into the plist file.

iPhone app Update Vs new version

Let's say I have an existing IOS app live on Appstore which is version 1.0
Now I make some changes to the app and want to submit back.
Are there 2 separate ways to submit ?
Like can I still keep the version as 1.0 and just submit the app OR
I need to create a new version 1.1 and then submit it ?
What are the differences in the process?
Also from the customer end, how does this work for new/existing users ?
I have just discovered something about version upgrades and the App Store. Just now, I'm suffering issues and users crashes because of a behavior of iOS system that I can't figure before. And, very important, iTunes, AppStore and iOS have modified some upgrading and installing rules in last versions. Now, it works this way:
- When user install a new version, all the files in the bundle are downloaded and copied in the previous existing bundle, but OLD FILES OR COMPONENTS ARE NOT DELETED (or not all are deleted). So, the final bundle IS NOT equal to the bundle of a fresh installation of the new version.
- For example, if a xib/nib file is localized to different languages for the new version, the updated bundle will include both versions: the one in the root folder and the other one in each localized folder. The system, obviously, will use the first one and only a fresh installation will show localizations for that file.
One of my apps shows that issue with MainWindow.xib and as there are some modifications in references and classes, the updated apps crash each time you try to run as it is using a obsolet object. I have built a new version changing the name of the xib/nib files that have been localized. As MainWindow is one of them, I have to modify the reference in info.plist of course.
OK, knowing that, you can build a new version with complete different components in the bundle that, if files of previous version does exist, the app then offers the user the option of using them. That is, two versions of the app in a single icon and bundle. Not very difficult to do.
BUT, the very weird thing is that I think that new iOS version and iTunes don't allow downgrades. I have tried to do it but didn't get it done. That is, if you install a version, for example 1.2, it is impossible AFAIK to install latter v1.1 on the device nor in iTunes->"Applications". So, the double version bundle will live until a reinstallation of the app.
You need to create a new version number, which makes sense since this is a new version of your app. This will then appear as an update for your customers. I don't think you can upload a new binary with the same version without removing the old one from the store.
You add a new version in iTunes connect, then update the version number in Xcode to match and create a new archive. It's pretty straightforward.
You must always increase the version number of any update to your app.
Users will see a badge on the App Store icon on the device, and in iTunes on their PC. Going into the updates section, it will list your app along with the list of changes you've provided, and a button to install the update. They can also update all apps at once.
NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:#"CFBundleVersion"];
NSLog(#"version is%#",version);
You do not have to open version numbers to submit any longer. Open up Xcode, go to Window - Organizer - Archives and Distribute an app you have created successfully.

How to test an update process prior to release?

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.

What precisely happens when iOS installs an update to an app?

What is the official, documented behavior when you install an update to an app?
This question asks the same thing, but the answer, which says that the app bundle is replaced but all other folders are untouched, does not provide any documentation. I have reason to believe that the app bundle, in fact, is not replaced, so I'd like to know for sure.
Please link to documentation!
From the iOS Application Programming Guide (see the "Files Saved During Application Updates" section within "The File System"):
When a user downloads an application
update, iTunes installs the update in
a new application directory. It then
moves the user’s data files from the
old installation over to the new
application directory before deleting
the old installation. Files in the
following directories are guaranteed
to be preserved during the update
process:
<Application_Home>/Documents
<Application_Home>/Library
Although
files in other user directories may
also be moved over, you should not
rely on them being present after an
update.
What you're seeing in the Why isn't my iPhone app bundle replacing the old one during an update? question is an issue where Xcode doesn't correctly detect/push updated resources to the device, which is a very different scenario.

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.