Activity
The following command, run whilst working with iCloud with apps (such as Smultron 4 and TextEdit) that support Mobile Documents –
sudo opensnoop -n ubd
– shows local files opened by the ubiquity daemon. Files include databases, one database per peer. One directory per peer at the following path:
~/Library/Application Support/Ubiquity
Types of data
If you wish to measure progress, decide which types to measure:
- Core Data
- documents
- key-value.
Saves, progress and measurement
Core Data
… The change log files, not the store file, are uploaded to iCloud and
downloaded to each of a user’s other devices. When a change log
arrives from another device attached to the same iCloud account, Core
Data updates your app’s local copy of the SQLite database, based on
the received change log. iCloud and Core Data ensure that each local
database is updated with the same set of changes. …
Consider: without interpreting the content of a change log, will it be worthwhile to measure progress of upload of the log file?
Documents
In the Mac Developer Library:
… Document-based apps can adopt autosaving in place, and its documents
are automatically saved at appropriate times …
Also:
Automatic Data-Saving Strategies Relieve the User
… appropriate points in your code where any user-related changes
should be saved and write those changes to disk automatically. …
Some appropriate times when you can save user data automatically
include the following:
- When the user closes the app window or quits the app (applicationWillTerminate:)
- When the app is deactivated (applicationWillResignActive:)
- When the user hides your app (applicationWillHide:)
- Whenever the user makes a valid change to data in your app
The last item means that you have the freedom to save the user’s data
at any time it makes sense to do so. For example, if the user is
editing fields of a data record, you can save each field value as it
is changed or you can wait and save all fields when the user displays
a new record. Making these types of incremental changes ensures that
the data is always up-to-date but also requires more fine-grained
management of your data model. …
Consider: those saves may be so frequent, and the amounts so small, that measurement will be not worthwhile.
item-info.db
I toyed with SQLite Database Browser to browse the item-info.db database for the peer that seems to be my local Mac. As I suspected, the app could browse only whilst the system was not using the database – within two seconds of using Preview to edit an Untitled.png in iCloud, I could no longer browse the database … and so on.
References
iCloud Design Guide
Mac App Programming Guide: The Core App Design: