WatchKit: Can’t Debug Parent App Background Fetch
| Originator: | SlaunchaMan | ||
| Number: | rdar://19521345 | Date Originated: | 1/19/2015 |
| Status: | Duplicate/20311699/Open | Resolved: | |
| Product: | iOS SDK | Product Version: | Xcode Version 6.2 (6C107a) |
| Classification: | UI/Usability | Reproducible: | Always |
Summary:
We are using background fetch in an iPhone app and also using Darwin notifications to keep the WatchKit interface up-to-date when new data comes in. We are trying to test that that will work if a background fetch event happens while the user is interacting with the iPhone. Unfortunately, it doesn't appear that there's a way to test background fetch at the same time as a WatchKit app.
Steps to Reproduce:
1. Create an iPhone app that updates data in a background fetch.
2. Add a WatchKit extension to it.
3. Run the WatchKit extension in the simulator.
4. In Xcode, select “Debug→Simulate Background Fetch.”
Expected Results:
The background fetch happens.
Actual Results:
The background fetch does not happen.
Version:
Xcode Version 6.2 (6C107a)
Notes:
Since it’s difficult to determine if a background fetch is happening while the console output is only shown for the watch app (rdar://19386708), I use this code snippet at the beginning of ‑[UIApplicationDelegate application:performFetchWithCompletionHandler:]:
[@"" writeToFile:@"/Users/jeff/Desktop/start"
atomically:YES
encoding:NSUTF8StringEncoding
error:NULL];
If the file appears on your desktop, then the fetch started.
Configuration:
iPhone Simulator (OS X 10.10.1 (14B25))
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!