6.1 · The process, the sandbox, entitlements and privacy prompts
Before any of your code runs, the system has already decided what your process may touch. These questions are about that boundary: what the operating system enforces on you, and what you must ask for.
Mental model. An iOS app is a signed program in a locked room. The room (sandbox), the keys it is allowed (entitlements) and the permissions the user grants (privacy prompts) are three separate checks, made by different parts of the system.
Process and sandbox
What an app process is, and where its files live.
- What is the iOS process model, and what can an app process not do?
Each app runs as its own process with a private virtual address space, started by the system (via launchd and the runtime that supervises apps) when the user… - What is the app container, and why must you never persist an absolute path?
The sandbox gives every app two containers. The bundle container holds the signed .app (read-only). The data container holds everything the app writes…
Permission to act
Entitlements that the system grants, and privacy consent the user grants.
- What are entitlements, and what happens when they do not match the provisioning profile?
An entitlement is a signed key-value pair embedded in your app’s code signature that grants a capability the sandbox would otherwise deny: push notifications… - How do privacy permissions work, and what do you do after the user says no?
Access to the camera, microphone, photos, contacts, location, Bluetooth, tracking and similar data is controlled by the system’s consent layer (historically…
More in iOS platform internals
- 6.2 · App and scene lifecycle in UIKit and SwiftUI
- 6.3 · The run loop, its modes, and the main-thread contract
- 6.4 · The launch path: dyld, initialisers and the first frame
- 6.5 · Background modes, BGTaskScheduler and background transfers
- 6.6 · Memory warnings, jetsam and the watchdog
- 6.7 · Info.plist, URL schemes, universal links and associated domains
- 6.8 · App groups, keychain groups and extensions as separate processes
- 6.9 · How a process dies, what it costs, what confines it and what seals it
- 6.10 · Threads and run loops, observers, and what actually runs in a custom mode
- 6.11 · Launch arguments, the scene callbacks, and reading a binary and its plists