Sub topic 1
How iCloud Drive keeps files in step
Prerequisites
This chapter assumes you have the following:
- An Apple Account.
- Basic use of Finder and System Settings on macOS.
- A working idea of files and folders.
You do not need Terminal skills for this chapter. A short command appears near the end, and you can skip it.
The working model
iCloud Drive is a sync service. It does not just back up your files. It keeps one master copy of each file in Apple's cloud and keeps matching copies on your devices. When you change a file on one device, the change goes up to the cloud, and the cloud passes it to your other devices.
Three parts matter:
- The cloud copy. This is the copy every device agrees with.
- Local copies. Each Mac, iPhone, or iPad can hold a full copy of a file or only a placeholder for it. A placeholder is a small stand-in that shows the name and icon but not the content.
- The sync daemon. A background process on your Mac watches the iCloud Drive folder. It uploads changes and downloads new ones without you starting anything.
Because the cloud holds the master copy, a file stays safe if you lose a device. Deleting a file is different. A delete also syncs, so the file disappears from every device. Keep this point in mind, because it explains many surprises later in the tutorial.
How a change travels
Follow one edit through the system.
- You save a document in the iCloud Drive folder on your Mac.
- The sync daemon notices the change and uploads it.
- The cloud stores the new version and records that it is the latest.
- Your iPhone, signed in to the same Apple Account, learns of the change and downloads it, or updates its placeholder.
The steps are not instant. Large files, a slow connection, or a sleeping device delay them. The result is eventual consistency: the devices agree once the transfers finish, but they can disagree for a short time.
What lives where
Where a file physically sits depends on your settings. Later chapters cover them in detail. For now, remember the possible states:
| State | Cloud copy | Copy on your Mac |
|---|---|---|
| Fully synced | Yes | Yes, full content |
| Optimized | Yes | Placeholder only |
| Uploading | Not yet complete | Yes, full content |
| Downloading | Yes | Arriving |
A file shown in Finder is therefore not always on your disk. If you open a placeholder, the Mac downloads it first. Offline, that fails.
Common errors in the mental model
- Treating iCloud Drive as a backup. A deleted or overwritten file is replaced everywhere. Recently deleted items can be recovered for a limited time, but this is not a full backup.
- Assuming changes are instant. Check the status before you unplug, shut down, or sign out.
- Assuming every device sees the same files. All devices must use the same Apple Account, and each must have iCloud Drive turned on.
- Assuming files in Finder are local. A cloud icon means the content is not on this Mac yet.
A first look from Terminal
macOS keeps your iCloud Drive in a folder inside your home directory. This command lists it:
ls -la "$HOME/Library/Mobile Documents/com~apple~CloudDocs"The quotes are needed because the path contains a space. Reading the folder is safe. Moving or deleting files here syncs the same way as in Finder.
Exercise
You delete a file from iCloud Drive on your Mac. Later you notice it is gone from your iPhone too. Why did this happen, and what does it show about iCloud Drive?
Show answer
The delete synced to the cloud copy and then to every device signed in to the same Apple Account. iCloud Drive keeps devices in step, so it is a sync service and not a backup. A deleted file can only be restored from Recently Deleted for a limited time.
Exercise
A file appears in Finder on your Mac, but you cannot open it on a flight. What is the likely cause?
Show answer
The Mac holds only a placeholder, and the content is in the cloud. Opening it needs a download, which needs an internet connection.