MobileNativeFoundation / MobileNativeFoundation/rules_xcodeproj
Bug: Unable to debug BGTaskScheduler with BwB
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 626
- Forks
- 124
- PR merge metrics
- No merged PRs in 30d
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 https://github.com/MobileNativeFoundation/rules_xcodeproj/discussions/2391
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the minimal BGTaskScheduler reproduction described in the issue and compare the projects generated by BwX and BwB. Follow Apple's LLDB simulation command for each generated project; done means the scheduled task reaches its breakpoint in BwB as it does in BwX.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- build-system, mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100