snippets
I am absolutely going to forget this (again) but if your app has a background task scheduled with BGTaskScheduler you can manually trigger it by pausing the app in the Xcode debugger and running the debug command
e -l objc -- (void)[[BGTaskScheduler sharedScheduler] _simulateLaunchForTaskWithIdentifier:@"com.your.domain.task-id"]
When you continue the app it will trigger your background task.
You have to do this on a real device since BGTaskScheduler is not present on simulators.
snippets
In your applications Info.plist add a new setting for Application Scene Delegate. Xcode will create a dictionary with 2 entries.
- Enable Multiple Scenes
- Scene Configuration
Enable Multiple Scenes is a boolean with a default value of NO. Change this to YES.
snippets
Create a new visionOS simulator. Command takes a name, device type, and runtime.
% xcrun simctl create "TestAVP" com.apple.CoreSimulator.SimDeviceType.Apple-Vision-Pro-4K com.apple.CoreSimulator.SimRuntime.xrOS-26-2
4F8B10C1-90F3-4E91-8A73-AED33CACE123
devlogs
In Xcode I recently encountered an issue where all of my simulators disappeared. In Xcode the canvas would only show a preview for the macOS build and I had no option to preview for any other Apple platform.
The “Devices and Simulator” window was completely empty. The target platforms and simulators are listed as installed in Settings->Components screen in Xcode’s settings.
On the command line, we can confirm this by running xcrun simctl list. Here we see that there are no devices available.