Description
Description
Apple provides private APIs to assist with debugging scheduled background tasks during development:
Starting and Terminating Tasks During Development
In our project, this technique works when generating via BwX but not when generating via BwB.
Reproduction steps
- Create an app leveraging
BGTaskScheduler
- Follow the debug instructions as provided by Apple:
To launch a task:
Set a breakpoint in the code that executes after a successful call to submit(_:).
Run your app on a device until the breakpoint pauses your app.
In the debugger, execute the line shown below, substituting the identifier of the desired task for TASK_IDENTIFIER.
Resume your app. The system calls the launch handler for the desired task.
e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"TASK_IDENTIFIER"]
- Repeat for BwX (works), BwB (does not work)
Expected behavior
Scheduled tasks result in a breakpoint being triggered in BwB
rules_xcodeproj version
1.7.0
Xcode version
14.3
Bazel version
6.2
rules_apple version
No response
rules_swift version
No response
Additional information
This is a note I've had for a few months, but it was only needed in the moment which had passed and I didn't want to write up an issue without a minimal repro.
I'm writing this up now to track and link to for #2391