I’m having trouble running my app on the simulator, and I believe the issue started after I installed Xcode v14.3.
The first time I run the app, everything works fine. However, when I try to rebuild and run it again while the app is still running on the simulator, I encounter a black screen 95% of the time. The simulator becomes unresponsive and I have to manually close it. After doing so, I see an error message (attached at the end of this post).
I have tried several solutions to resolve this issue, but none have been successful so far. Here are the steps I have taken:
- Erased all content and settings on the simulator.
- Removed the Derived Data folder.
- Checked my firewall settings to ensure it’s not blocking the app, but the firewall is disabled.
- Reinstall the command line tools.
- Open Xcode using Rosetta
- Formatted my Mac and performed a clean installation of Xcode along with everything else.
Unfortunately, none of the above steps have resolved the problem.
The only temporary solution I have found is to turn off the "Debug executable" option:
However, this solution is not ideal as it disables the entire debug mode tool. Therefore, I am still searching for a more appropriate resolution to this problem.
This error seems to occur only in a specific app project and not in another project. This indicates that the issue might be related to the configuration or code specific to the problematic project.
I’m using Mac with M1 chip.
the error details:
The operation couldn’t be completed. (Mach error -308 - (ipc/mig) server died)
Domain: NSMachErrorDomain
Code: -308
User Info: {
DVTErrorCreationDateKey = "2023-05-22 10:00:49 +0000";
IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
}
--
Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
"device_model" = "iPhone15,2";
"device_osBuild" = "16.4 (20E247)";
"device_platform" = "com.apple.platform.iphonesimulator";
"launchSession_schemeCommand" = Run;
"launchSession_state" = 1;
"launchSession_targetArch" = arm64;
"operation_duration_ms" = 5226;
"operation_errorCode" = "-308";
"operation_errorDomain" = NSMachErrorDomain;
"operation_errorWorker" = IDELaunchiPhoneSimulatorLauncher;
"operation_name" = IDERunOperationWorkerGroup;
"param_consoleMode" = 0;
"param_debugger_attachToExtensions" = 0;
"param_debugger_attachToXPC" = 1;
"param_debugger_type" = 3;
"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_checker_tpc_enable" = 1;
"param_diag_gpu_frameCapture_enable" = 0;
"param_diag_gpu_shaderValidation_enable" = 0;
"param_diag_gpu_validation_enable" = 1;
"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" = 0;
"param_runnable_appExtensionHostRunMode" = 0;
"param_runnable_productType" = "com.apple.product-type.application";
"param_testing_launchedForTesting" = 0;
"param_testing_suppressSimulatorApp" = 0;
"param_testing_usingCLI" = 0;
"sdk_canonicalName" = "iphonesimulator16.4";
"sdk_osVersion" = "16.4";
"sdk_variant" = iphonesimulator;
}
--
System Information
macOS Version 13.3.1 (a) (Build 22E772610a)
Xcode 14.3 (21812) (Build 14E222b)
Timestamp: 2023-05-22T13:00:49+03:00
When running my application, I encountered another error which triggered a warning message in the logs. I believe this warning might be connected to the issue I’m facing:
Warning: Error creating LLDB target at path '/Debug-iphonesimulator/YourApp.app'- using an empty LLDB target which can cause slow memory reads from remote devices.
2
Answers
Ok so after TONS of tests, I fixed it by removing ALL
from the project's target build settings & from all the pods build settings.
I’ve faced similar issue like yours but for me, can run the project for the first time in the simulator but for the consecutive run, simulator keeps showing black screen. The following steps fix the issue for me
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64"
if you have any for debugAny iOS Simulator
build settingPods
, then remove them in the pod file [and pod install]show rosetta destination
inProduct/Destination/Destination Architecture
Follow the above steps, you should be able to run now.