问题
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!
回答1:
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.
回答2:
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.
回答3:
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
来源:https://stackoverflow.com/questions/33539534/testflight-alert-while-testing-update-you-already-have-this-app-installed