I posted here https://developer.apple.com/forums/thread/805554?page=1#867766022 but posting again for visibility (and let me know how I can file a bug)
There was a response in that thread that said you could use the childProgress system to help updating progresses to keep the backgroundTask alive.
What I've found is that using childProgresses results in more terminations than if you just updated the progress directly.
Here is my setups to test this
A BGContinuedProcessingTask that uses URLSessions to upload, and registers the task.progress with the Urlsession Progress
Same, but the task.progress gets updated via a UrlSession Callback
The second is MUCH more stable out in the field in cellular settings, the first fails extremely frequently.
My suspicion is that in the documentation here https://developer.apple.com/documentation/foundation/progress#Reporting-Progress-for-Multiple-Operations
it explicitly states
The completedUnitCount property for a containing progress object only updates when the suboperation is 100% complete. The fractionCompleted property for a containing progress object updates continuously as work progresses for all suboperations.
I wonder if BGContinuedProcessingTask is only looking at completedUnitCount for progress, and not fractionCompleted?
In either case, I would love to use the childProgresses because there are bugs with retries by updating the progress manually, so would love some help resolving this, Thanks!
Processes & Concurrency
RSS for tagDiscover how the operating system manages multiple applications and processes simultaneously, ensuring smooth multitasking performance.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Created
I've tuned my task to be decently resilient, but I found a few issues that caused it to expire regularly.
excessive CPU usage -> I'm actually running it behind ReactNative, and I found an issue where I was still updating ReactNative and thus it was keeping it alive the entire time the task was running. Removing this update helped improve stability
not updating progress frequently enough ( see https://developer.apple.com/forums/thread/809182?page=1#868247022)
My feature request is, would it be possible to get a reason the task was expired in task.expirationHandler? That would be helpful for both the user and for debugging why the task was expired. Thanks!
Hi there,
I'm trying to work on an architecture where one app exposes an API (Extension Host) that other apps can plugin to. I've been reading all I can from the docs and whatever I can find online. It seemed like iOS26 added the ability to do such a thing (at least in early builds).
Is that the case?
Has the functionality been walked back such that extensions can only be loaded in iOS from within the single app bundle?
My use case is the following:
I'm working on an agent app that desires to have 3rd party developers add functionality (think how MCP servers add functionality to LLMs). The 3rd party plugins would be provided in their own app bundles vetted by the AppStore review team, of course, and would only provide hooks, basically, the main app can use to execute functions or get state.
This is the best thread I found on the topic, and the subtext is that it needs to be in the same bundle. https://developer.apple.com/forums/thread/803896?answerId=865314022#865314022
Let's say for the moment that this isn't possible using ExtensionKit. What's the best way to achieve this? Our current best alternative idea is a hidded WebKit window that runs JS/WASM but that's so hackish.
Please let me know, thanks!
Hello everybody!
I'm currently working on a Bluetooth Low Energy Sync that is using BGTaskScheduler & successfully running periodically in the Background on iOS 26. I did watch this years WWDC Session 227 (Finish tasks in the background) & follow the recommendations as suggested.
Currently, the App is only using 37 Mb (iPhone 12 mini) & no Location or other services are running in Background.
However, when opening Safari & scrolling through some webpages, the App is killed because of "Terminated due to memory issue". I profiled the App & followed advice when it comes to reducing the memory footprint of the App. Are there any additional steps I can take to prevent the App being killed? Are there any recommendations for periodically scheduled Tasks when it comes to the Interval? Do more frequent Tasks (30min compared to one or two hours) have any impact? I tried many different schedules but none seem to make a difference.
From my observation, the App is first suspended & eventually killed because of the Memory Pressure. Any hints, suggestions or recommendations are highly appreciated!
Thanks a lot for the support!
We are seeing a strange lifecycle issue on multiple MDM-managed iPads where
application(_:didFinishLaunchingWithOptions:) is not called after the device is idle overnight.
Even if we terminate the app manually via the app switcher, the next morning the system does not perform a cold launch. Instead, the app resumes directly in:
applicationDidBecomeActive(_:)
This causes all initialization logic that depends on didFinishLaunching to be completely skipped.
This behavior is consistent across four different supervised MDM devices.
Environment
Devices: iPads enrolled in MDM (supervised)
iOS version: 18.3
Xcode: 16.4
macOS: Sequoia 15.7.2
App type: Standard UIKit iOS app
App: Salux Audiometer (App Store app)
Expected Behavior
If the app was terminated manually using the app switcher, the next launch should:
Start a new process
Trigger application(_:didFinishLaunchingWithOptions:)
Follow the normal cold-start lifecycle
Actual Behavior
After leaving the iPad idle overnight (8–12 hours):
The next launch skips didFinishLaunching
The app resumes directly in applicationDidBecomeActive
No new process is started
App behaves as if it had been suspended, even though it was manually terminated
Logs (Relevant Extracts)
Day 1 — Normal cold launch
[12:06:44.152 PM] PROCESS_STARTED
[12:06:44.214 PM] DID_FINISH_LAUNCHING_START launchOptions=[]
[12:06:44.448 PM] DID_FINISH_LAUNCHING_END
We then used the app and terminated it via app switcher.
Day 2 — Unexpected resume without cold start
[12:57:49.328 PM] APP_DID_BECOME_ACTIVE
No PROCESS_STARTED
No didFinishLaunching
No cold-start logs
This means the OS resumed the app from a previous state that should not exist.
Reproducible Steps
Use an MDM-enrolled iPad.
Launch the app normally.
Terminate it manually via the multitasking app switcher.
Leave the device idle overnight (8–12 hours).
Launch the app the next morning.
Observe that:
didFinishLaunching does not fire
applicationDidBecomeActive fires directly
Questions for Apple Engineers / Community
Is this expected behavior on MDM-supervised devices in iOS 18?
Are there any known OS-level changes where terminated apps may be revived from disk/memory?
Could MDM restrictions or background restoration policies override app termination?
How can we ensure that our app always performs a clean initialization when launched after a long idle period?
Additional Information
We have full logs from four separate MDM iPads showing identical behavior.
Happy to share a minimal reproducible sample if required.
Regarding App Update Synchronization During Workout Mode:
My watchOS app has workout mode enabled. When I update the app from the App Store on my iPhone while a workout session is active on my Apple Watch, the update does not sync to the watch. Why does this happen, and when can I expect the watch app to be updated?
Regarding Automatic App Launch After a Prolonged Shutdown:
I would like my watchOS app to launch automatically on my Apple Watch after it has been powered off for an extended period and then turned back on. Is this functionality possible to implement? If not, please provide a definitive answer regarding this capability.
I have an older project that was created before Xcode 26.2.
In Xcode versions prior to 26.2, there was no Swift Compiler – Concurrency build setting.
With those older versions, the following behavior occurs: a nonisolated function executes off the main thread.
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
run()
}
private func run() {
Task {
await runInMainThread()
}
}
func runInMainThread() async {
print(">>>> IN runInMainThread(), Thread.isMainThread \(Thread.isMainThread)")
await runInBackgroundThread()
}
private nonisolated func runInBackgroundThread() async {
print(">>>> IN runInBackgroundThread(), Thread.isMainThread \(Thread.isMainThread)")
}
}
Output:
>>>> IN runInMainThread(), Thread.isMainThread true
>>>> IN runInBackgroundThread(), Thread.isMainThread false
However, starting with Xcode 26.2, Apple introduced the Swift Compiler – Concurrency settings.
When running the same code with the default configuration:
Approachable Concurrency = Yes
Default Actor Isolation = MainActor
This is the output
Output:
>>>> IN runInMainThread(), Thread.isMainThread true
>>>> IN runInBackgroundThread(), Thread.isMainThread true
the nonisolated function now executes on the main thread.
This raises the following questions:
What is the correct Swift Compiler – Concurrency configuration if I want a nonisolated function to run off the main thread?
Is nonisolated still an appropriate way to ensure code runs on a background thread?
I'm making an operator Publisher, which has to wrap the upstream publisher. But I want the operator to conditionally conform to ConnectablePublisher, but only when the upstream publisher does the same.
I can make my connect() call the upstream's connect(), but is that all I have to do? That Apple's plumbing will automatically hold back the initial call to the Subscription object if the publisher is connectable. Otherwise, I need to make a flag in the subscription for when to connect, which would involve an infinitely copyable struct somehow send a message to a unique class/actor.
That last part makes sense to me, but it also seems like too much work for something plug-and-play. Having Apple's implementation taking care of that issue also makes sense, and would be a better solution.
I built an iOS app and debugged it using my iPhone 11. It works fine. My app uses Bluetooth because the physical data logger reads data via Bluetooth. I published it to the Apple store. After installing it on the iPhone 13 pro. The app works, but the device is not selected.
I’m reaching out regarding an issue we’ve been experiencing with BGProcessingTask since upgrading to Xcode 26.1.1.
Issue Summary
Our daily background processing task—scheduled shortly after end‑of‑day—has stopped triggering reliably at night. This behavior started occurring only after updating to Xcode 26.1.1. Prior to this update, the task consistently ran around midnight, executed for ~10–15 seconds, and successfully rescheduled itself for the next day.
Expected Behavior
BGProcessingTask should run at/near the scheduled earliestBeginDate, which we set to roughly 2 hours after end-of-day.
The task should execute, complete, and then reschedule itself.
Actual Behavior
On devices running builds compiled with Xcode 26.1.1, the task does not trigger at all during the night.
The same code worked reliably before the Xcode update.
No system logs indicate rejection, expiration, or background task denial.
Technical Details
This is the identifier we use:
private enum DayEndProcessorConst {
static let taskIdentifier = "com.company.sdkmanagement.daysummary.manager"
}
The task is registered as follows: When app launched
BGTaskScheduler.shared.register(
forTaskWithIdentifier: DayEndProcessorConst.taskIdentifier,
using: nil
) { [weak self] task in
self?.handleDayEndTask(task)
}
And scheduled like this:
let date = Calendar.current.endOfDay(for: Date()).addingTimeInterval(60 * 60 * 2)
let request = BGProcessingTaskRequest(identifier: DayEndProcessorConst.taskIdentifier)
request.requiresNetworkConnectivity = true
request.requiresExternalPower = false
request.earliestBeginDate = date
try BGTaskScheduler.shared.submit(request)
As per our logs, tasks scheduled successfully
The handler wraps the work in an operation queue, begins a UI background task, and marks completion appropriately:
task.setTaskCompleted(success: true)
Could you please advise whether:
There are known issues with BGProcessingTask scheduling or midnight execution in Xcode 26.1.1 or iOS versions associated with it?
Any new entitlement, configuration, or scheduler behavior has changed in recent releases?
Additional logging or diagnostics can help pinpoint why the scheduler never fires the task?
I am developing a remote support tool for macOS. While we have successfully implemented a Privileged Helper Tool and LaunchDaemon architecture that works within an active Aqua session, we have observed a total failure to capture the screen buffer or receive input at the macOS Login Window.
Our observation of competitor software (AnyDesk, TeamViewer) shows they maintain graphical continuity through logout/restart. We are seeking the official architectural path to replicate this system-level access.
Current Technical Implementation
Architecture: A root-level LaunchDaemon manages the persistent network connection. A PrivilegedHelperTool (installed in /Library/PrivilegedHelperTools/) is used for elevated tasks.
Environment: Tested on macOS 14.x (Sonoma) and macOS 15.x (Sequoia) on Apple Silicon.
Capture Methods: We have implemented ScreenCaptureKit (SCK) as the primary engine and CGDisplayCreateImage as a fallback.
Binary Status: All components are signed with a Developer ID and have been successfully Notarized.
Observed Behavior & Blockers
The "Aqua" Success: Within a logged-in user session, our CGI correctly identifies Display IDs and initializes the capture stream. Remote control is fully functional.
The "Pre-Login" Failure: When the Mac is at the Login Window (no user logged in), the following occurs:
The Daemon remains active, but the screen capture buffer returns NULL or an empty frame.
ScreenCaptureKit fails to initialize, citing a lack of graphical context.
No TCC (Transparency, Consent, and Control) prompt can appear because no user session exists.
The "Bootstrap" Observation: We have identified that the loginwindow process exists in a restricted Mach bootstrap namespace that our Daemon (running in the System domain) cannot natively bridge.
Comparative Analysis (Competitor Benchmarking)
We have analyzed established remote desktop solutions like AnyDesk and Jump Desktop to understand their success at the login screen. Our findings suggest:
Dual-Context Execution: They appear to use a Global LaunchAgent with LimitLoadToSessionType = ["LoginWindow"]. This allows a child process to run as root inside the login window’s graphical domain.
Specialized Entitlements: These apps have migrated to the com.apple.developer.persistent-content-capture entitlement. This restricted capability allows them to bypass the weekly/monthly TCC re-authorization prompts and function in unattended scenarios where a user cannot click "Allow."
Questions
Entitlement Requirement: Is the persistent-content-capture entitlement the only supported way for a third-party app to capture the LoginWindow buffer without manual user intervention?
LaunchAgent Strategy: To gain a graphical context at the login screen, is it recommended to load a specialized agent into the loginwindow domain via launchctl bootstrap loginwindow ...?
ScreenCaptureKit vs. Legacy: Does ScreenCaptureKit officially support the LoginWindow session, or does it require an active Aqua session to initialize?
MDM Bypass: For Enterprise environments, can a Privacy Preferences Policy Control (PPPC) payload grant "Screen Recording" to a non-entitled Daemon specifically for the login window context?
Topic:
App & System Services
SubTopic:
Processes & Concurrency
Tags:
macOS
Security
ScreenCaptureKit
Service Management
I tried making a concurrency-safe data queue. It was going well, until memory check tests crashed.
It's part of an unadvertised git project. Its location is:
https://github.com/CTMacUser/SynchronizedQueue/commit/84a476e8f719506cbd4cc6ef513313e4e489cae3
It's the blocked-off method "`memorySafetyReferenceTypes'" in "SynchronizedQueueTests.swift."
Note that the file and its tests were originally AI slop.
Knows anyone a point in systemlog etc. To find out when and why my or other apps are terminated by os.
At the moment a lot of apps inclusive my apps seems to be terminated instead set to sleep by OS if no power coord is connected
There are no crashlogs recorded, Sentry or firebase don‘t report issues.
Topic:
App & System Services
SubTopic:
Processes & Concurrency
I’ve built an app that connects via Bluetooth to a device. The device sends up, down, left and right commands.
I want to build an SDK for other third party developers to use so that whenever a third party app with the SDK opens, if we press a button on the device, my app which captures the button press should be able to forward the event to the third party app.
I want to achieve this with the lowest latency possible so that I can enable a variety of use cases like simple games and interactions within other apps.
What would be the best way for me to achieve this as part of my SDK and my app?
This is a successor to:
https://developer.apple.com/forums/thread/814231
I went into a slightly different direction. I generated more AI slop that use NSLock. Then I had the NSLock usage changed to Mutex usage. Now it crashes with:
Task 13: EXC_BREAKPOINT (code=1, subcode=0x18d29326c)
On one of the mutex closures. With an extended description:
warning: TypeSystemSwiftTypeRef::operator(): had to engage SwiftASTContext fallback for type $s7Combine10PublishersO21LineBreakingPublisherE11SplitAtZeroV12Subscription33_D18F5AAE73662968F407B0A79FBD1F8DLLCy_x_qd__GD
I put the class, a Subscription nested in its corresponding Publisher operator, in the given file
Subscription.txt