Published
How iOS Stores Your Files: On My iPhone, iCloud Drive, and App Sandboxes
Every file you send to your phone has to land somewhere specific. Here's what an app sandbox actually is, and why On My iPhone and iCloud Drive behave so differently.
What it is
Send yourself a PDF and it has to land somewhere specific — not "on the phone" in some general sense, but inside one particular folder that belongs to one particular app. Most people never think about that part. It explains almost everything else about how files behave on iOS.
Every app on your iPhone gets its own sandbox: a home directory created automatically at install, in a location the system picks at random. One app can't read or write another app's files directly — there's no shared folder sitting in the middle that every app can see into. Inside that sandbox, the app itself splits in two. A signed, read-only bundle holds the app's code, never backed up, and it breaks if anything modifies it. The data container is the other half, where the app keeps a Documents folder for the things you'd recognize as yours, a Library folder for its own settings and support files, and a tmp folder for anything genuinely disposable. Only some of that gets backed up. Documents does. Caches and temp files don't — the system assumes it can recreate or discard them without asking.
Why it matters
This is why a document you open in one app doesn't just show up in another. There's no default shared drive on the phone the way there might be on a shared computer — each app works out of its own private folder, and the OS enforces that boundary at the system level. It's a deliberate trade-off: the same isolation that keeps a careless app from reading your banking app's data is what makes moving a file between two apps feel like a small, explicit act instead of something that just happens.
It also explains why some things vanish and others don't. A file sitting in an app's cache folder can disappear the moment the system needs space, with no warning, because caches were never meant to be permanent. A file in Documents survives a restore, a new phone, a reinstall. Knowing which folder a file is actually in tells you whether it's safe to assume it'll still be there next week.
Where you'll see it
The clearest place this shows up day to day is in the Files app, where two separate top-level locations sit side by side: On My iPhone and iCloud Drive. They look similar. They don't behave anything alike.
On My iPhone stores a file only on that device. It never syncs anywhere. Lose the phone or reset it without a backup, and that file is gone — only a full device backup can bring it back, not iCloud file sync.
iCloud Drive works differently. The app writes the file to the device first, then the operating system uploads it automatically once you have a network connection. From there it shows up on every other device signed into the same Apple Account with iCloud Drive turned on. That convenience isn't free, though: iCloud Drive storage counts against your shared iCloud plan — 5 GB free, more if you pay for iCloud+ — while On My iPhone storage only uses the device's own capacity and sits outside that quota entirely.
The Files app is also one of the sanctioned bridges between sandboxes. Along with the document picker and the share sheet, it's how iOS lets you move a file from one app's private folder into another's without breaking the isolation described above. Quick Look is the quieter version of the same idea — a system-level preview that can look inside a file without handing full access to whichever app is asking.
How Margina handles it
Margina keeps the documents you send it inside its own sandboxed Documents folder, same as any other app on the phone — which is a big part of why it can run with no account and no server. Nothing to sign into, nothing being uploaded to us, because there's no "us" waiting on the other end of a connection.
That changes what backup means, too. Margina doesn't back your library up to its own infrastructure, because it doesn't have any. If you want a copy that survives a lost or reset phone, the way to do it is to back up your reading library to your own iCloud — the same iCloud Drive mechanism described above, under your control, not ours. (Cross-platform sync between iPhone and Android isn't part of this — that's a separate, unsupported thing, distinct from iCloud Drive file sync.)
Frequently Asked Questions
What's the difference between On My iPhone and iCloud Drive?
On My iPhone stores a file only on that device — it doesn't sync anywhere and survives only through a full device backup. iCloud Drive writes the file locally first, then the OS uploads it once you have a network connection, so it appears on every device signed into the same Apple Account with iCloud Drive turned on.
Why can't one app just open a file that's inside another app?
Every iOS app gets its own sandboxed home directory, randomly assigned at install, and the system won't let one app read or write another app's files directly. To move a file between apps, iOS routes the request through an explicit shared pathway — the Files app, a document picker, or the share sheet — rather than a raw file path.
Does storing a file in iCloud Drive count against my iCloud storage?
Yes. iCloud Drive storage is billed against your shared iCloud plan (5 GB free, more via iCloud+). Files kept On My iPhone only use the device's own storage and aren't part of that quota.
Where does an app like Margina keep the documents I send it?
Margina keeps your documents in its own sandboxed Documents folder on the device, which is what makes it work with no account and no server. If you want a copy that survives a lost or reset phone, you back it up to your own iCloud — the app doesn't do that automatically on its own server, because it doesn't have one.
Conclusion
The sandbox isn't really a limitation — it's the reason a phone can hold a dozen document apps at once without any of them stepping on each other. Once you know where a file actually lives, the choice between On My iPhone and iCloud Drive stops being a toggle you ignore. It becomes a real decision about what you're trading: convenience and sync, against a copy that answers to no one but the device in your hand.