Does installing an iOS app via TestFlight simulate an app upgrade? - ios

I read in this Stackoverflow question that to simulate an app upgrade on an iPhone, you should install a new Ad Hoc IPA of the file via iTunes.
You can therefore check if the users data is still intact after an update.
I use TestFlight and quite often install new development versions of the app from there. Does this also simulate an app update?

You can test this by saving some data from the app, and doing the TestFlight upgrade. If the data are still there, then I think that shows that it does behave like an app upgrade.
When I did these sorts of updates, I think the data stayed, but I recommend testing to be sure.

Related

Do I have to rebuild my app for every iOS new version release to make it available at the AppStore?

I think this is not required, at my personal experience only new iOS specific features in my application will require a new release, but a personal client is asking me to confirm this.
With every new XCode release, do I have to rebuild and publish my application in order to make it available at the AppStore of new iOS Release?
If there is any official documentation that proves this will be appreciated!
You do not need to re-publish. Apps remain in the App Store until the developer pulls it (or very rarely, Apple pulls it due to policy violations).
There is likely not any documentation that explicitly states this, but consider a scenario where somebody gets the new iPhone 13 and opts to restore it from iCloud. Data is pulled from iCloud, but apps are restored by re-installing them from the App Store. If apps disappeared from the App Store because they haven't been re-compiled, then anybody who upgraded their phone would discover that a large number of their apps had disappeared.
Anecdotally, my company has apps in the App Store that haven't seen a new submission in over 2 years (since iOS 12). Those apps are still in the store.
You can test your iOS app using the new Xcode 13 and if you got some bug using the new iOS SDK, you can fix it and submit a new version to App Store using the new Xcode.
Its prudent to test your apps on each new OS (preferably before the public release) but in most cases no new release is necessary. Over time you may want to update your app to take advantage of new features or to better support new devices. No app will never last forever but you will likely be able to go some time before having to update.

How do I test code that runs on update for IOS apps?

My app contains code that must modify the DB in the documents directory on update of the app (because the structure of the DB has changed between versions).
The loading of the new version of the app to a phone via xcode works fine, and runs the code correctly. However I'm concerned that this may not exactly mirror what happens when updating via the app store on the phone.
In order to properly test that this code runs correctly when a user updates their app through the app store, I gather it used to be possible to load the app via an ad hoc distribution, which would install it as if it were an update from the app store. The (rather old) instructions for that are here:
https://developer.apple.com/library/archive/technotes/tn2285/_index.html
I attempted this, by exporting the ad hoc .ipa file and dragging onto the device in ITunes, only for it to tell me the app is already installed. The .ipa file contains the updated app and it has a higher version number than the one installed on the device.
Do I need to do this another way? Or is loading the app via xcode sufficient to emulate what the user's phone will do when updating the app?
Thanks

Unable to download iOS app from App Store but works in Test Flight

I have an app that has been on the App Store for a few months now with about 6 previous updates that have gone very smoothly. I use Test Flight to test the app on my device before submitting. This time around everything looked fine on Test Flight as usual so I went ahead and submitted the app for review. It was approved and the status switched to ready for sale, however, when I tried to download the App from the App Store it said it was unable to downlaoad again with the options to try again or done. I have tried it on numerous devices and it appears to be a problem for everyone, not just myself. This happens even though the same build worked great with Test Flight. Can anybody help? A lot of people have failed to download or update their app and it is affecting us a lot.
Now, i understand that you have checked several devices and all got the same installation issue.
But i think, it is important for you to know,
You might face issue in installing app from App Store, with TestFlight build still installed in your device.
Please try uninstalling the Test Flight build first and then install app from App Store.

TestFlight alert while testing update: You already have this app installed

I was trying to test update scenario from live App Store app build to RC using TestFlight, but TestFlight gives me alert "You already have this app installed. Do you want to replace..." (see below screenshot). After confirmation, all data from App Store version is gone.
Steps I do:
Install live app from the App Store
Login and do some operations to get data in the app and Keychain
Go to TestFlight iOS app
Tap "Install" button in TestFlight -> alert "You already have this app installed" appears
If I tap choose Install, new build is installed
Result:
The app's content including Shared Container (data shared with Extensions) and Keychain are completely wiped when I open the app again
Edit: The alert in TestFlight appears with any app (I have tried multiple different apps from different dev accounts). The actual data deletion happens only for some.
My question:
Is this expected behaviour from TestFlight or is it any issue with my app? I'm not aware of any changes between versions which could cause any issues.
I believe this was not happening before (the last time I tried was few weeks ago).
I couldn't find any documentation or release notes regarding TestFlight app behaviour or changes.
Did anyone experience the same issue? Or do you know any resources describing this behaviour?
Thanks for any answers!
After long research, trials and errors, creating radar and releasing update to App Store, I have an answer:
Alert is there always and does not have relation to losing data.
The alert with warning about possible lose of data is being displayed always for any app being installed from TestFlight over the Non TestFlight Build.
This was true for any of multiple apps I have tried.
identifierForVendor changes when overwriting app with TestFlight build.
When you have App Store version of the app installed and overwrite it with build from TestFlight, result of [[UIDevice currentDevice] identifierForVendor] changes
This is unexpected since it is not mentioned in the documentation (see below)
In my case unexpected change of identifierForVendor was causing "loose of data" which wasn't actual lose of data, but it is happening only for TestFlight builds which you cannot debug, so it was hard to find the issue.
Documentation of [[UIDevice currentDevice] identifierForVendor] says:
The value in this property remains the same while the app (or another app from the same vendor) is installed on the iOS device. The value changes when the user deletes all of that vendor’s apps from the device and subsequently reinstalls one or more of them. The value can also change when installing test builds using Xcode or when installing an app on a device using ad-hoc distribution.
as per best of my knowledge,
if you have installed application from App Store (suppose of version number 1.0) on your device, and lets say your are again downloading/installing same app with same version number 1.0 from TestFlight, you will get above message.
This is because you are trying to install app with same version and bundle id that already does exists on device.Offcourse you will lose data/settings of app, as its replacing your app not updating.I also gone through this scenario.
If you have the full version of an app installed on your device and you install the same Beta App, your app data may be corrupted or lost and may not be recoverable. You should back up your information before installing a Beta App.
http://www.apple.com/legal/internet-services/itunes/testflight/sren/terms.html
I don't know how this happens

App Crashes When Downloaded From App Store But Not When Testing

I have a serious issue which I cannot seem to solve.
Recently I have made an update to an IOS app, and when testing in XCODE as both Ad-Hoc, Debug, and installing via the .IPA on a device the issue cannot be replicated. However when I download the app from the App Store, it crashes.
Does anyone know how this could happen, and any potential solutions? I am getting lots of complaints from users, and not sure what to do?
Could part of the binary upload have got corrupted?
Probably you always compiled your app in debug mode. But when sent to App Store you made a release compile. click the arrow in the run button select scheme and chose "release mode" and run your app it will probably crash.
check if you used NSParameterAssert as they are not called in release mode
I cannot say why your live App Store application is crashing and the debug version is not. Two possible solutions:
Crash reports:
To find out why your application crashed, you might want to check if there are any crash reports available on iTunes Connect. Log in on iTunes Connect and click on your application. Scroll down to Crash Reports. You will find out more about why your application is crashing here.
More information about crash reports here at Apple's own iOS Developer Library.
Prerelease your app with TestFlight: For in the future: test your application by uploading it on iTunes Connect and testing it with TestFlight first before submitting the application to the iTunes Store. This will save you a lot of (review) time if you find a error.
I realize this is an old thread but I had the same issue with my App that I released. Meaning it worked fine in testing, but when I released it it would crash. The culprit ended up being the fact that I am using In App Purchases. I have two items that can be "bought" but I had only enabled one of them. In testing it was able to read both of them, but with the release version, it was only pulling the one that was enabled down, creating the crash. The fix was simply enabling the disabled item. I didn't even have to redistribute the app, though I had to wait for it to "percolate" through... Anyway this may help someone in the future.
Check if your app is looking for too many IAPs.
I just had this problem and my problem was I had deleted an IAP from the App Store, but didn't remove it from the app code.
For some reason it only crashed when downloaded; I used a promo code to do this before launching my app.
Thanks to Tornado for the inspiration to try this variation.

Resources