|Tip 25||Access (and Back Up) All iCloud Documents|
iCloud magically stores your data online whenever you choose to save or modify a file there. However, “hard copies” of any documents within iCloud are actually stored on your Mac’s hard disk within a hidden directory. These files are automatically updated by the iCloud system service running in the background whenever any changes are made, either on your Mac or on other devices that access the files via iCloud.
Browsing the iCloud Store Folder
To browse to the iCloud store folder, open Finder, and then hit Shift+Command+G. Then type the following into the dialog box that appears:
Note how the icon at the top of the Finder window changes to show the fact you’re browsing iCloud files.
The folder containing documents for each app will be named along the lines of com~apple~, followed by the name of the app. For example, the folder containing TextEdit documents is called com~apple~TextEdit.
There are two schools of thought when it comes to whether you should edit the files. Some people say that double-clicking the files within the hidden iCloud folder, to edit or view them, is just like accessing them via the app in question’s iCloud file browser. However, other people (myself included) advise a more cautious approach because this is, after all, an unauthorized way of accessing the files. I advise treating everything you see as read-only: never delete, edit, or add to the files you see in ~/Library/Mobile Documents because you might seriously corrupt your iCloud account. Bear in mind that even opening a file can sometimes lead to a new version being instantly saved, so it’s best to use Quick Look only if you want to view files (select the file in Finder and hit Space).
Adding files to iCloud should be done using the application itself (see Tip 28, Quickly Get Documents into (and out of) iCloud).
Creating an iCloud-Browsing Shortcut
You can easily create a custom search for Finder’s sidebar that, when selected, will automatically list all files stored within iCloud—regardless of which application was used to save them. Here’s how:
Open Finder, hit Shift+Command+G, and then type ~/Library/Mobile Documents into the dialog box that appears. Then click the Go button.
Click in the Search field at the top right of the Finder window, and then hit Space. This will clear the list of files within Finder, but don’t worry—it’ll make sense in a moment.
In the Search bar that appears, select Mobile Documents. Then click the plus icon at the right side of the line.
A new search bar will be added. In the left drop-down list within it, ensure that Kind is selected. In the drop-down alongside, ensure Document is selected. You should now see all your iCloud files listed, regardless of the application used to save them.
Click the Save button in the search bar. This will show a dialog box where you can type a name for what will be the Finder sidebar link you’ll click in the future. Call it something like iCloud, and click the Save button in the dialog box.
An icon will appear under the Favorites heading on the left of the Finder window. Clicking this will show all iCloud files. To delete it, hold down Command and drag the icon out of the Finder window, before releasing. The icon will disappear in a puff of smoke.
Backing Up iCloud Files Independently
By knowing where the files are stored, you can manually back them up using a third-party cloud backup service like SpiderOak (http://www.spideroak.com), for example. This provides an extra layer of insurance against a fault arising within the iCloud system. Just include the ~/Library/Mobile Documents folder in the list of those to be backed up.
Note that iCloud files are automatically backed up within Time Machine, as explained in Tip 90, Use Time Machine with iCloud.