XPC Errors when launching in simulator

I cannot debug any applications anymore since upgrading to latest Ventura (13.3) and XCode 14.3.

First - None of the iOS 16.X simulators work AT ALL. When I choose an iOS 16 target simulator, the simulator window comes up but is completely blank and never starts. Pressing HOME button, resetting device data, restarting device do not fix the issue. I've deleted and re-installed the simulators multiple times and nothing works.

Error detail when trying to launch 16.4 simulator:

Domain: FBSOpenApplicationServiceErrorDomain
Code: 5
Failure Reason: Unexpected error type.
User Info: {
    BSErrorCodeDescription = InvalidResponse;
    DVTErrorCreationDateKey = "2023-04-04 03:47:36 +0000";
    IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
    SimCallingSelector = "launchApplicationWithID:options:pid:error:";
}
--
The request to open "***.***.XXXXXX" failed.
Domain: FBSOpenApplicationServiceErrorDomain
Code: 5
Failure Reason: Unexpected error type.
User Info: {
    BSErrorCodeDescription = InvalidResponse;
}
--
The operation couldn’t be completed. XPC error received on message reply handler
Domain: BSServiceConnectionErrorDomain
Code: 3
Failure Reason: XPC error received on message reply handler
User Info: {
    BSErrorCodeDescription = OperationFailed;
}
--

Second - I can use iOS 15.2 simulators, but cannot attach debugger to them. XCode will launch my app but will not actually let me debug it or attach a debugger to it after launch.

Error detail when launching 15.2 debuggable simulator:

Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: attach failed (Not allowed to attach to process.  Look in the console messages (Console.app), near the debugserver entries, when the attach failed.  The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)
User Info: {
    DVTErrorCreationDateKey = "2023-04-04 03:41:19 +0000";
    DVTRadarComponentKey = 855031;
    IDERunOperationFailingWorker = DBGLLDBLauncher;
    RawUnderlyingErrorMessage = "attach failed (Not allowed to attach to process.  Look in the console messages (Console.app), near the debugserver entries, when the attach failed.  The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.)";
}

I see no errors in any of the console or system logs that would indicate what the problem could be.

I have deleted the DerivedData, wiped the cache clean from the Storage Settings section in the settings.app.

XCode seems to get worse with every minor update, at this point I cannot debug my apps anymore and have found no solutions.

I am also facing the same issue

After a significant amount of time digging through online forums, I found a fix that works for me.

You must have the following settings in the "Build Settings"

  1. in "Deployment" section, you must have "Deployment Postprocessing" == NO for debug builds and YES for release builds
  2. in "Signing" section, you must have "Code Signing Inject Base Entitlements" == YES for debug and NO for release builds.

Most of the online help fail to mention the DEPLOYMENT_POSTPROCESSING part. I have no idea how it got reset to the wrong values, it is not something I recall ever changing, but that is what was wrong with my configuration. Once I changed those 2 values to be correct, I am able to attach the debugger to the simulator and debug my apps again.

I should note that I still cannot get the iOS 16.X simulators to work in any fashion, they just come up as a black screen on the simulated iPhone window. The above fix just allows me to debug on iOS 15.X simulators.

XPC Errors when launching in simulator
 
 
Q