SBMainWorkspace - 请求被服务委托拒绝

Loi*_*zuc 6 xcode ios-simulator swift

I\xe2\x80\x99m 在模拟器上启动应用程序时遇到错误,即:请求被服务委托(SBMainWorkspace)拒绝。

\n

我知道有一些关于此错误的主题,但任何解决方案都适合我。\n\xe2\x80\xa8这是我已经尝试过的:

\n
    \n
  • 干净的派生数据+项目
  • \n
  • 重置模拟器
  • \n
  • 检查空环境变量(对于所有目标 + pod)
  • \n
  • 更新Xcode
  • \n
  • 重新安装Xcode
  • \n
  • 重新启动Mac(多次)
  • \n
  • 删除项目并重新克隆它
  • \n
  • 检查 Mach-O 类型构建设置是否设置为可执行文件
  • \n
  • 尝试不同的模拟器(iPhone 15、15 Pro 和 15 Plus)
  • \n
  • 尝试不同的 iOS 版本(16、17 和 17.0.1)
  • \n
  • 分解+重新安装pod
  • \n
  • 杀死模拟器,重新启动 Xcode
  • \n
  • 上面同时提到的很多事情
  • \n
\n

请注意,此错误仅发生在一个特定项目上。我可以在模拟器上正常运行任何其他项目。\n同一项目在其他 Mac 上也可以正常运行。

\n

这里\xe2\x80\x99是我的配置:\nXcode 15.0.1 (15A507)\nMacOS Sonoma 14.0\nMac mini M2

\n

这里\xe2\x80\x99是完整的错误日志:

\n
Simulator device returned an error for the requested operation.\nDomain: FBSOpenApplicationServiceErrorDomain\nCode: 1\nFailure Reason: The request was denied by service delegate (SBMainWorkspace).\nUser Info: {\n    BSErrorCodeDescription = RequestDenied;\n    FBSOpenApplicationRequestID = 0x9ca3;\n    IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;\n    SimCallingSelector = "launchApplicationWithID:options:pid:error:";\n}\n--\nThe request to open "com.---------" failed.\nDomain: FBSOpenApplicationServiceErrorDomain\nCode: 1\nFailure Reason: The request was denied by service delegate (SBMainWorkspace).\nUser Info: {\n    BSErrorCodeDescription = RequestDenied;\n    FBSOpenApplicationRequestID = 0x9ca3;\n}\n--\nThe operation couldn\xe2\x80\x99t be completed. The process failed to launch.\nDomain: FBProcessExit\nCode: 64\nFailure Reason: The process failed to launch.\nUser Info: {\n    BSErrorCodeDescription = "launch-failed";\n}\n--\nThe operation couldn\xe2\x80\x99t be completed. Launch failed.\nDomain: RBSRequestErrorDomain\nCode: 5\nFailure Reason: Launch failed.\n--\nLaunchd job spawn failed\nDomain: NSPOSIXErrorDomain\nCode: 111\n--\n\nEvent Metadata: com.apple.dt.IDERunOperationWorkerFinished : {\n    "device_model" = "iPhone16,1";\n    "device_osBuild" = "17.0.1 (21A342)";\n    "device_platform" = "com.apple.platform.iphonesimulator";\n    "dvt_coredevice_version" = "348.1";\n    "dvt_mobiledevice_version" = "1643.2.4";\n    "launchSession_schemeCommand" = Run;\n    "launchSession_state" = 1;\n    "launchSession_targetArch" = arm64;\n    "operation_duration_ms" = 11035;\n    "operation_errorCode" = 1;\n    "operation_errorDomain" = FBSOpenApplicationServiceErrorDomain;\n    "operation_errorWorker" = IDELaunchiPhoneSimulatorLauncher;\n    "operation_name" = IDERunOperationWorkerGroup;\n    "param_debugger_attachToExtensions" = 0;\n    "param_debugger_attachToXPC" = 1;\n    "param_debugger_type" = 3;\n    "param_destination_isProxy" = 0;\n    "param_destination_platform" = "com.apple.platform.iphonesimulator";\n    "param_diag_MainThreadChecker_stopOnIssue" = 0;\n    "param_diag_MallocStackLogging_enableDuringAttach" = 0;\n    "param_diag_MallocStackLogging_enableForXPC" = 1;\n    "param_diag_allowLocationSimulation" = 1;\n    "param_diag_checker_tpc_enable" = 1;\n    "param_diag_gpu_frameCapture_enable" = 0;\n    "param_diag_gpu_shaderValidation_enable" = 0;\n    "param_diag_gpu_validation_enable" = 0;\n    "param_diag_memoryGraphOnResourceException" = 0;\n    "param_diag_queueDebugging_enable" = 1;\n    "param_diag_runtimeProfile_generate" = 0;\n    "param_diag_sanitizer_asan_enable" = 0;\n    "param_diag_sanitizer_tsan_enable" = 0;\n    "param_diag_sanitizer_tsan_stopOnIssue" = 0;\n    "param_diag_sanitizer_ubsan_stopOnIssue" = 0;\n    "param_diag_showNonLocalizedStrings" = 0;\n    "param_diag_viewDebugging_enabled" = 1;\n    "param_diag_viewDebugging_insertDylibOnLaunch" = 1;\n    "param_install_style" = 0;\n    "param_launcher_UID" = 2;\n    "param_launcher_allowDeviceSensorReplayData" = 0;\n    "param_launcher_kind" = 0;\n    "param_launcher_style" = 0;\n    "param_launcher_substyle" = 0;\n    "param_runnable_appExtensionHostRunMode" = 0;\n    "param_runnable_productType" = "com.apple.product-type.application";\n    "param_structuredConsoleMode" = 1;\n    "param_testing_launchedForTesting" = 0;\n    "param_testing_suppressSimulatorApp" = 0;\n    "param_testing_usingCLI" = 0;\n    "sdk_canonicalName" = "iphonesimulator17.0";\n    "sdk_osVersion" = "17.0";\n    "sdk_variant" = iphonesimulator;\n}\n--\n
Run Code Online (Sandbox Code Playgroud)\n

更新

\n

我尝试使用另一个 Xcode 版本(14.3.1)但没有成功,出现同样的错误。在我的个人手机上完美运行..

\n

我用这个命令调查日志:

\n
xcrun simctl spawn booted log show --info --debug --predicate 'processImagePath contains "CoreSimulatorBridge"'\n
Run Code Online (Sandbox Code Playgroud)\n

我发现了很多奇怪的日志,上面写着“引导失败”,但这对我来说太深了,无法理解。如果您需要,我会为您提供更多日志详细信息。

\n

Jer*_*rin 11

在过去 24 小时内,我一直在尝试上述步骤并再次格式化我的整个系统。
最终对我有用的是我试图避免的步骤。
在终端上运行以下命令安装 Rosetta:
softwareupdate --install-rosetta