Xcode simulator black screen with error: "The operation couldn’t be completed. (Mach error -308 – (ipc/mig) server died)"

huangapple go评论74阅读模式
英文:

Xcode simulator black screen with error: "The operation couldn’t be completed. (Mach error -308 - (ipc/mig) server died)"

问题

我在模拟器上运行我的应用程序时遇到问题,我认为问题是在安装Xcode v14.3后开始的。

第一次运行应用程序时,一切正常。但是,当我尝试重新构建并再次运行应用程序时,而应用程序仍在模拟器上运行时,95% 的情况下我会遇到黑屏。模拟器变得无响应,我必须手动关闭它。在这样做之后,我看到一个错误消息(附在此帖子的末尾)。

我尝试了几种解决此问题的方法,但到目前为止都没有成功。以下是我采取的步骤:

  1. 擦除模拟器上的所有内容和设置。
  2. 删除Derived Data文件夹。
  3. 检查防火墙设置,确保不会阻止应用程序,但防火墙已禁用。
  4. 重新安装命令行工具。
  5. 使用Rosetta打开Xcode。
  6. 格式化我的Mac并重新安装Xcode以及其他所有内容。

不幸的是,以上所有步骤都没有解决问题。
我找到的唯一临时解决方案是关闭“调试可执行文件”选项:

Xcode simulator black screen with error: "The operation couldn’t be completed. (Mach error -308 – (ipc/mig) server died)"

然而,这个解决方案并不理想,因为它会禁用整个调试模式工具。因此,我仍在寻找更合适的解决方案来解决这个问题。

这个错误似乎只发生在特定的应用程序项目中,而在另一个项目中没有发生。这表明问题可能与有问题的项目的配置或代码有关。

我使用的是搭载M1芯片的Mac。

错误详细信息:

操作无法完成。(Mach错误 -308 -(ipc/mig)服务器已停止)
域:NSMachErrorDomain
代码:-308
用户信息:{
DVTErrorCreationDateKey = "2023-05-22 10:00:49 +0000";
IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
}

分析事件: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;
}

系统信息

macOS版本13.3.1(a)(构建22E772610a)
Xcode 14.3(21812)(构建14E222b)
时间戳:2023-05-22T13:00:49+03:00

在运行我的应用程序时,我遇到了另一个错误,触发了日志中的警告消息。我认为这个警告可能与我遇到的问题有关:

警告:在路径'/Debug-iphonesimulator/YourApp.app'处创建LLDB目标时出错- 使用空的LLDB目标可能会导致从远程设备读取内存变慢。

英文:

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:

  1. Erased all content and settings on the simulator.
  2. Removed the Derived Data folder.
  3. Checked my firewall settings to ensure it's not blocking the app, but the firewall is disabled.
  4. Reinstall the command line tools.
  5. Open Xcode using Rosetta
  6. 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:

Xcode simulator black screen with error: "The operation couldn’t be completed. (Mach error -308 – (ipc/mig) server died)"

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.

答案1

得分: 1

我遇到过类似的问题,但对我来说,可以在模拟器中第一次运行项目,但在连续运行时,模拟器始终显示黑屏。以下步骤解决了我的问题:

  1. 如果在调试的“Any iOS Simulator”构建设置中有"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64",请移除它。
  2. 如果你在Pods中设置了它,请在Pod文件中移除它们,然后运行pod install
  3. 关闭Xcode和模拟器。
  4. 打开Xcode,选择Product/Destination/Destination Architecture中的show rosetta destination

按照上述步骤,现在你应该能够运行了。

英文:

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

  1. remove "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64" if you have any for debug Any iOS Simulator build setting
  2. if you happened to have set it for Pods, then remove them in the pod file [and pod install]
  3. close Xcode/simulator
  4. open Xcode and select show rosetta destination in Product/Destination/Destination Architecture

Follow the above steps, you should be able to run now.

答案2

得分: 0

I fixed it by removing ALL

exclude architecture arm64
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;

from the project's target build settings & from all the pods build settings.

英文:

Ok so after TONS of tests, I fixed it by removing ALL

exclude architecture arm64
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;

from the project's target build settings & from all the pods build settings.

huangapple
  • 本文由 发表于 2023年5月22日 18:37:44
  • 转载请务必保留本文链接:https://go.coder-hub.com/76305322.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定