Simulator keeps stopping to work

Hi, I am new to Xcode and just starting to write my first lines of code. When I start my app on the Simulator it works fine the first time. Sometimes one code change also works, but then I always run into problems. The Simulator does not update or run properly anymore.

I tried killing all Simulator processes, restarting xCode, stopping most other running apps, nothing worked but to reboot.

Anyone an idea what to do?

Here are two of the error messages that pop up:

Error message 1

Couldn’t communicate with a helper application.
Domain: NSCocoaErrorDomain
Code: 4099
Recovery Suggestion: Try your operation again. If that fails, quit and relaunch the application and try again.
User Info: {
  DVTErrorCreationDateKey = "2022-04-14 18:58:11 +0000";
  IDERunOperationFailingWorker = "_IDEInstalliPhoneSimulatorWorker";
  NSDebugDescription = "The connection to service named com.apple.l s d.installation was invalidated: failed at lookup with error 32 - Broken pipe.";
}
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
  "device_model" = "iPhone14,5";
  "device_osBuild" = "15.4 (19E240)";
  "device_platform" = "com.apple.platform.iphonesimulator";
  "launchSession_schemeCommand" = Run;
  "launchSession_state" = 1;
  "launchSession_targetArch" = "x86_64";
  "operation_duration_ms" = 25354;
  "operation_errorCode" = 4099;
  "operation_errorDomain" = NSCocoaErrorDomain;
  "operation_errorWorker" = "_IDEInstalliPhoneSimulatorWorker";
  "operation_name" = IDERunOperationWorkerGroup;
  "param_consoleMode" = 0;
  "param_debugger_attachToExtensions" = 1;
  "param_debugger_attachToXPC" = 1;
  "param_debugger_type" = 1;
  "param_destination_isProxy" = 0;
  "param_destination_platform" = "com.apple.platform.iphonesimulator";
  "param_diag_MainThreadChecker_stopOnIssue" = 0;
  "param_diag_MallocStackLogging_enableDuringAttach" = 0;
  "param_diag_MallocStackLogging_enableForXPC" = 1;
  "param_diag_allowLocationSimulation" = 1;
  "param_diag_gpu_frameCapture_enable" = 0;
  "param_diag_gpu_shaderValidation_enable" = 0;
  "param_diag_gpu_validation_enable" = 0;
  "param_diag_memoryGraphOnResourceException" = 0;
  "param_diag_queueDebugging_enable" = 1;
  "param_diag_runtimeProfile_generate" = 0;
  "param_diag_sanitizer_asan_enable" = 0;
  "param_diag_sanitizer_tsan_enable" = 0;
  "param_diag_sanitizer_tsan_stopOnIssue" = 0;
  "param_diag_sanitizer_ubsan_stopOnIssue" = 0;
  "param_diag_showNonLocalizedStrings" = 0;
  "param_diag_viewDebugging_enabled" = 1;
  "param_diag_viewDebugging_insertDylibOnLaunch" = 1;
  "param_install_style" = 0;
  "param_launcher_UID" = 2;
  "param_launcher_allowDeviceSensorReplayData" = 0;
  "param_launcher_kind" = 0;
  "param_launcher_style" = 0;
  "param_launcher_substyle" = 2;
  "param_runnable_appExtensionHostRunMode" = 2;
  "param_runnable_productType" = "com.apple.product-type.app-extension";
  "param_runnable_swiftVersion" = "5.6";
  "param_runnable_type" = 3;
  "param_testing_launchedForTesting" = 0;
  "param_testing_suppressSimulatorApp" = 0;
  "param_testing_usingCLI" = 0;
  "sdk_canonicalName" = "iphonesimulator15.4";
  "sdk_osVersion" = "15.4";
  "sdk_variant" = iphonesimulator;
}
--

System Information

macOS Version 12.3.1 (Build 21E258)
Xcode 13.3.1 (20103) (Build 13E500a)
Timestamp: 2022-04-14T19:58:11+01:00

Error message 2

Details

SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'bundle.id' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=5 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedDescription=The request to open "com.apple.springboard" failed., NSLocalizedFailureReason=Unexpected error type., NSUnderlyingError=0x600002c44870 {Error Domain=BSServiceConnectionErrorDomain Code=3 "XPC error received on message reply handler" UserInfo={BSErrorCodeDescription=OperationFailed, NSLocalizedFailureReason=XPC error received on message reply handler}}, BSErrorCodeDescription=InvalidResponse}." UserInfo={NSLocalizedDescription=Failed to show Widget 'bundle.id' error: Error Domain=FBSOpenApplicationServiceErrorDomain Code=5 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedDescription=The request to open "com.apple.springboard" failed., NSLocalizedFailureReason=Unexpected error type., NSUnderlyingError=0x600002c44870 {Error Domain=BSServiceConnectionErrorDomain Code=3 "XPC error received on message reply handler" UserInfo={BSErrorCodeDescription=OperationFailed, NSLocalizedFailureReason=XPC error received on message reply handler}}, BSErrorCodeDescription=InvalidResponse}., NSUnderlyingError=0x600002c448a0 {Error Domain=FBSOpenApplicationServiceErrorDomain Code=5 "The request to open "com.apple.springboard" failed." UserInfo={NSLocalizedDescription=The request to open "com.apple.springboard" failed., NSLocalizedFailureReason=Unexpected error type., NSUnderlyingError=0x600002c44870 {Error Domain=BSServiceConnectionErrorDomain Code=3 "XPC error received on message reply handler" UserInfo={BSErrorCodeDescription=OperationFailed, NSLocalizedFailureReason=XPC error received on message reply handler}}, BSErrorCodeDescription=InvalidResponse}}}
Domain: DTXMessage
Code: 1
User Info: {
    DVTErrorCreationDateKey = "2022-04-14 17:30:13 +0000";
}
--


System Information

macOS Version 12.3.1 (Build 21E258)
Xcode 13.3.1 (20103) (Build 13E500a)
Timestamp: 2022-04-14T18:30:13+01:00
Answered by momonu in 710921022

I found the problem. I had the widget extension selected as target. And this would launch the app, but crash in subsequent calls. It also did not show any debug output. When I select the main app, it works fine. Only that I do not get the output of the extension in my log.

Which simulator do you try to use ?

Does it occur with other simulators ?

Maybe you have had an installation problem on Xcode. Try to

I use the Simulator.app and tried it with with iPhone 12 and iPhone 13 devices. It happened with both of them. Do you have a recommendation to try another device? Or what other simulator could I try?

I will try reinstalling Xcode. Thanks!

Accepted Answer

I found the problem. I had the widget extension selected as target. And this would launch the app, but crash in subsequent calls. It also did not show any debug output. When I select the main app, it works fine. Only that I do not get the output of the extension in my log.

Simulator keeps stopping to work
 
 
Q