英文:
Xcode simulator black screen with error: "The operation couldn’t be completed. (Mach error -308 - (ipc/mig) server died)"
问题
我在模拟器上运行我的应用程序时遇到问题,我认为问题是在安装Xcode v14.3后开始的。
第一次运行应用程序时,一切正常。但是,当我尝试重新构建并再次运行应用程序时,而应用程序仍在模拟器上运行时,95% 的情况下我会遇到黑屏。模拟器变得无响应,我必须手动关闭它。在这样做之后,我看到一个错误消息(附在此帖子的末尾)。
我尝试了几种解决此问题的方法,但到目前为止都没有成功。以下是我采取的步骤:
- 擦除模拟器上的所有内容和设置。
- 删除Derived Data文件夹。
- 检查防火墙设置,确保不会阻止应用程序,但防火墙已禁用。
- 重新安装命令行工具。
- 使用Rosetta打开Xcode。
- 格式化我的Mac并重新安装Xcode以及其他所有内容。
不幸的是,以上所有步骤都没有解决问题。
我找到的唯一临时解决方案是关闭“调试可执行文件”选项:
然而,这个解决方案并不理想,因为它会禁用整个调试模式工具。因此,我仍在寻找更合适的解决方案来解决这个问题。
这个错误似乎只发生在特定的应用程序项目中,而在另一个项目中没有发生。这表明问题可能与有问题的项目的配置或代码有关。
我使用的是搭载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:
- 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.
答案1
得分: 1
我遇到过类似的问题,但对我来说,可以在模拟器中第一次运行项目,但在连续运行时,模拟器始终显示黑屏。以下步骤解决了我的问题:
- 如果在调试的“Any iOS Simulator”构建设置中有
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64"
,请移除它。 - 如果你在
Pods
中设置了它,请在Pod文件中移除它们,然后运行pod install
。 - 关闭Xcode和模拟器。
- 打开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
- remove
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64"
if you have any for debugAny iOS Simulator
build setting - if you happened to have set it for
Pods
, then remove them in the pod file [and pod install] - close Xcode/simulator
- open Xcode and select
show rosetta destination
inProduct/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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论