【问题标题】:Application launch did not return a valid pid nor a launch error应用程序启动没有返回有效的 pid 也没有启动错误
【发布时间】:2021-12-29 19:50:12
【问题描述】:

我的应用在模拟器上安装良好,我可以在手动打开它后附加该进程,但它不会从调试播放按钮运行而不会引发以下错误。

我已经尝试了所有我知道的技巧(删除派生数据并重新编译,在这里和那里注释掉一些代码,穷举搜索关键字)。

任何帮助或见解将不胜感激。

Details

Application launch for '------' did not return a valid pid nor a launch error.
Domain: NSPOSIXErrorDomain
Code: 3
Failure Reason: No such process
User Info: {
    IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;
}
--

Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {
    "device_model" = "iPhone14,2";
    "device_osBuild" = "15.0 (19A339)";
    "device_platform" = "com.apple.platform.iphonesimulator";
    "launchSession_schemeCommand" = Run;
    "launchSession_state" = 1;
    "launchSession_targetArch" = "x86_64";
    "operation_duration_ms" = 845;
    "operation_errorCode" = 3;
    "operation_errorDomain" = NSPOSIXErrorDomain;
    "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_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_runnable_swiftVersion" = "5.5.1";
    "param_runnable_type" = 2;
    "param_testing_launchedForTesting" = 0;
    "param_testing_suppressSimulatorApp" = 0;
    "param_testing_usingCLI" = 0;
    "sdk_canonicalName" = "iphonesimulator15.0";
    "sdk_osVersion" = "15.0";
    "sdk_variant" = iphonesimulator;
}
--


System Information

macOS Version 11.6.1 (Build 20G224)
Xcode 13.1 (19466) (Build 13A1030d)
Timestamp: 2021-11-18T16:14:15-07:00

【问题讨论】:

  • 我遇到了同样的错误。只需重新启动模拟器即可解决。
  • 我有同样的错误,提供的两种解决方案都不适合我。

标签: ios swift xcode swiftui simulator


【解决方案1】:

好吧,原来这个神秘的无名环境变量已在方案中检查。我取消选中它并且它有效。

【讨论】:

    【解决方案2】:

    对我来说,解决方案是将 Mach-O 类型更改为 bundle,然后再次运行应用程序(同样的错误)并将其再次更改回 Executable。

    【讨论】:

    • 对我不起作用:(
    【解决方案3】:

    就我而言,我试图运行单元测试,但在模拟器上使用午餐应用程序后出现了类似的错误。

    对我有用的是我在构建单元测试目标时没有注意到编译器错误。修复测试目标构建问题后,应用程序再次正常运行。因此,请确保项目正在构建且没有任何错误。

    【讨论】:

    • 是的,即使测试目标显示构建成功,也存在编译器错误“问题导航器”。
    猜你喜欢
    • 1970-01-01
    • 2010-12-15
    • 2018-02-20
    • 2012-03-21
    • 1970-01-01
    • 2022-10-02
    • 1970-01-01
    • 2016-12-01
    • 1970-01-01
    相关资源
    最近更新 更多