For an iOS app that stores a SQLite database in its App Group container and has no extension targets, can iCloud restore, Finder or Apple Devices restore, or Quick Start replace a file in that container while the app's normal process remains alive, including while suspended?
No, though the question itself is somewhat misleading. The system doesn't actually need to worry about terminating apps prior to restoration because it never allows an app to launch before the app is restored. In most cases (there's some degree of parallelism), it doesn't actually download the app itself until it's already restored all of the app's files.
A few notes:
-
The app icon you see on your screen before the app is restored ISN'T actually a "valid" app object to the system itself. It's a special placeholder object, so it can't actually "launch". However, touching it will pump an app's priority in the restore queue so, particularly for small apps, it can look like it "launched immediately" when it was touched when what actually happened is that the restore jumped to the head of the line and completed quickly.
-
One thing that can trip apps up is that we won't (necessarily) have downloaded files from iCloud. Since they're stored in iCloud (not just the device), they aren't included in the backup itself, so they aren't restored. Apps shouldn't have a problem with this, but I have seen cases where apps had problems because they were inadvertently relying on particular iCloud files being present simply because app usage patterns meant they normally WERE present.
-
More generally, many data protection bugs can make it LOOK like your app's files didn't restore when the actual issue is simply that your app is confused about its own state. This forum post describes the issue in detail and this post has my recommendation on what to do if your app is running into these issues.
If iOS terminates the process first, can the app relaunch before all App Group files have finished restoring?
No. App Groups are considered "part" of an app's data, so an app can't be launched until all of its App Groups are present.
I don’t think this actually documented anywhere though.
Yeah, I don't think we ever have, mostly because the actual behavior is so direct—your app won't run until all of its data is there, so there isn't actually that much to document.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware