Add BGSessionFix tweak for simulator sessions

This commit is contained in:
√(noham)²
2026-08-24 16:54:19 +02:00
parent 58990b8ecc
commit 47d2f2ba89
7 changed files with 62 additions and 0 deletions

12
BGSessionFix/index.md Normal file
View File

@@ -0,0 +1,12 @@
Tweak that redirects background NSURLSession configurations to foreground (default) configurations, for use when developing/debugging apps in the iOS Simulator.
The iOS Simulator does not run `nsurlsessiond`, the system daemon that backs `NSURLSession` background transfers. Any app that uses `backgroundSessionConfigurationWithIdentifier:` to download or upload files (so the transfer can survive app suspension/termination on a real device) will fail in the Simulator with errors such as:
```
No XPC connection in Simulator
BackgroundSession <...> an error occurred on the xpc connection to setup
the background session: ... connection to service named com.apple.nsurlsessiond
BackgroundSession <...> failed to create a background NSURLSessionDownloadTask,
as remote session is unavailable
Task <...> finished with error [-1] "unknown error"
```