Error Domain=NSURLErrorDomain Code=-1009 "The Internet connection appears to be offline."
URLSession couldn’t reach the network — the device is offline, the app’s cellular data is disabled, or the simulator lost network access.
Seen on:
iOS
Meaning
Besides real offline states, iOS can block an app from cellular data (Settings → app → Mobile Data), VPN/content filters interfere, and simulators lose connectivity when the Mac changes networks.
Common causes
- Device/simulator offline
- Cellular data disabled for the app
- VPN/proxy/content filter blocking
- First-launch network permission (China region) not granted
⚡ Quick fix
- Check connectivity and the app’s cellular setting
- Restart the simulator after network changes
- Handle offline states gracefully (NWPathMonitor, waitsForConnectivity)
Detailed fix by platform
Swift
- swift
let config = URLSessionConfiguration.default config.waitsForConnectivity = true let session = URLSession(configuration: config)
How to diagnose
- Network — Other apps online?
- Settings — Cellular data for the app
- Simulator — Restarted?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- ATS App Transport Security has blocked a cleartext HTTP resource load
- CannotPullContainerError ECS task stopped: CannotPullContainerError: pull image manifest has been retried ... / ref pull has been retried
- iptables: No chain/target/match driver failed programming external connectivity on endpoint: iptables: No chain/target/match by that name
Most viewed in iOS
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026