SBMainWorkspace - 请求被服务委托拒绝

问题描述 投票:0回答:1

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

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

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

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

这是我的配置: Xcode 15.0.1 (15A507) MacOS 索诺玛 14.0

这是完整的错误日志:

Simulator device returned an error for the requested operation.
Domain: FBSOpenApplicationServiceErrorDomain
Code: 1
Failure Reason: The request was denied by service delegate (SBMainWorkspace).
User Info: {
    BSErrorCodeDescription = RequestDenied;
    FBSOpenApplicationRequestID = 0x9ca3;
    IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
    SimCallingSelector = "launchApplicationWithID:options:pid:error:";
}
--
The request to open "com.---------" failed.
Domain: FBSOpenApplicationServiceErrorDomain
Code: 1
Failure Reason: The request was denied by service delegate (SBMainWorkspace).
User Info: {
    BSErrorCodeDescription = RequestDenied;
    FBSOpenApplicationRequestID = 0x9ca3;
}
--
The operation couldn’t be completed. The process failed to launch.
Domain: FBProcessExit
Code: 64
Failure Reason: The process failed to launch.
User Info: {
    BSErrorCodeDescription = "launch-failed";
}
--
The operation couldn’t be completed. Launch failed.
Domain: RBSRequestErrorDomain
Code: 5
Failure Reason: Launch failed.
--
Launchd job spawn failed
Domain: NSPOSIXErrorDomain
Code: 111
--

Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "iPhone16,1";
    "device_osBuild" = "17.0.1 (21A342)";
    "device_platform" = "com.apple.platform.iphonesimulator";
    "dvt_coredevice_version" = "348.1";
    "dvt_mobiledevice_version" = "1643.2.4";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = arm64;
    "operation_duration_ms" = 11035;
    "operation_errorCode" = 1;
    "operation_errorDomain" = FBSOpenApplicationServiceErrorDomain;
    "operation_errorWorker" = IDELaunchiPhoneSimulatorLauncher;
    "operation_name" = IDERunOperationWorkerGroup;
    "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" = 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" = 0;
    "param_runnable_appExtensionHostRunMode" = 0;
    "param_runnable_productType" = "com.apple.product-type.application";
    "param_structuredConsoleMode" = 1;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphonesimulator17.0";
    "sdk_osVersion" = "17.0";
    "sdk_variant" = iphonesimulator;
}
--

更新

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

我用这个命令调查日志:

xcrun simctl spawn booted log show --info --debug --predicate 'processImagePath contains "CoreSimulatorBridge"'

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

swift xcode ios-simulator
1个回答
0
投票

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

softwareupdate --install-rosetta

© www.soinside.com 2019 - 2024. All rights reserved.