Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I have my Mac running OS X 10.8 set up so that I can see the contents of its iCloud repository at ~/Library/Mobile Documents (see this question and this question for more information on how that works). However, I'd like to be able to see / visualize / understand the sync state of my Mac:

  • Is my Mac in sync with iCloud?
  • If not, what is being uploaded / downloaded / how long will it take?
  • Are there any utilities or built-in features of OS X that will allow me to see any of this?

These are valid questions even without iCloud explicitly exposed in the filesystem, but are obviously more useful if you copy bulk numbers of files in/out of the iCloud repository explicitly.

share|improve this question
add comment

3 Answers

up vote 3 down vote accepted
+50

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:

share|improve this answer
    
That's pretty good, thanks. The command you give doesn't produce particularly user-friendly output (and doesn't really address insync/out-of-sync state, upload/download state, etc.), but it's closer than anything else so far. –  Andrew Ferrier Oct 24 '12 at 15:12
    
Thanks – in theory we might do more with DTrace-based commands such as iosnoop but not all things DTrace-related work perfectly on OS X. I, too, am curious about the things that are not covered by this answer. –  Graham Perrin Oct 26 '12 at 1:19
add comment

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.

share|improve this answer
    
Thanks for the answer. Had guessed this might be the case but I was hoping someone else had already reverse-engineered the traffic flow, built a tool, etc. –  Andrew Ferrier Oct 21 '12 at 21:12
add comment

If you REALLY want to see what's going on, you can use tcpdump (/usr/sbin/tcpdump), which does packet capture. It'll show you the packets as they go over the network. It's not the easiest, but it's the most comprehensive way to see this data.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.