Apple - Can the iCloud sync progress be observed?
There are no built-in OS X tools designed explicitly for showing you iCloud synchronise information.
As of OS X 10.8.2, Apple has not made this information public. Unless Apple publish OS X Application Programmer Interfaces (APIs) to provide the information you seek, no third party will be able to accurately provide the synchronisation details.
Given this, please give Apple's iCloud team feedback; let Apple's engineers know what you want and why.
While you wait, you can track connections to Apple's iCloud servers, measure traffic flow, and disk access. These metrics will provide some insight but they will not provide expected durations or percentage complete measures.
To explore the data flow, explore the OS X's built-in tools like lsof and netstat.
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:
- Document-Based Apps Are Based on an NSDocument Subclass: The Document Architecture Provides Many Capabilities for Free
- Support the Key Runtime Behaviors in Your Apps: Automatic Termination