I am encountering a persistent error when trying to run a brand new project that includes both an iOS App and a Watch App companion on a paired Simulator in Xcode 15.2.
The Environment:
The Problem: When I select the iOS App scheme and choose a paired simulator destination (iPhone + Watch), the build succeeds, but the installation fails immediately with the following error:
Simulator device returned an error for the requested operation.
Domain: NSPOSIXErrorDomain
Code: 2
Failure Reason: An application bundle was not found at the provided path.
Recovery Suggestion: Provide a valid path to the desired application bundle.
User Info: {
IDERunOperationFailingWorker = "_IDEInstalliPhoneSimulatorWorker";
SimCallingSelector = "installApplication:withOptions:error:";
bundleURL = "file:///Users/.../Debug-watchos/TestFitness%20Watch%20App.app";
}
It seems like Xcode is trying to install the Watch App via the iPhone simulator but fails to locate the bundle path, even though the file exists in DerivedData.
What I have tried so far (and failed): I have already tried the common solutions found on SO and Apple Forums, but none resolved the issue:
-
Clean Build Folder (
Cmd+Shift+K) and deletingDerivedDatamanually. -
Resetting Simulators:
Device -> Erase All Content and Settings. -
Creating a fresh Simulator Pair: Created a new iPhone 15 + Watch Series 9 pair in “Devices and Simulators”. The error persists even on a fresh pair.
-
Checking Bundle Identifiers: Confirmed that the iOS App ID (
com.example.MyApp) and Watch App ID (com.example.MyApp.watchkitapp) match and are correctly referenced inInfo.plist. -
Build Phases: Verified that “Embed Watch Content” exists in the iOS target Build Phases. I tried removing and re-adding it.
-
Sandboxing: Tried setting User Script Sandboxing to
Noin Build Settings for both targets. -
Deployment Targets: Tried lowering the deployment target for both iOS (to 17.0) and watchOS (to 9.0/10.0) to ensure no version mismatch with the Simulator runtime.
Current Workaround: The only way I can get it to run is by launching the iOS App scheme on the iPhone Simulator first, and then manually launching the Watch App scheme on the Watch Simulator separately. However, this is not ideal for testing connectivity and installing the app as a single bundle.
Has anyone faced this specific NSPOSIXErrorDomain Code: 2 on Xcode 15.2 with a fresh project? Is there a specific build setting I am missing?
Any help would be appreciated.