【问题标题】:Xcode 12.5.1 - Could not attach to pid: "####" - Lost ConnectionXcode 12.5.1 - 无法附加到 pid:“####” - 丢失连接
【发布时间】:2021-10-25 08:08:18
【问题描述】:

Error Message

每当我尝试在模拟器上运行我的任何 iOS 项目时,都会收到此错误消息。我该如何摆脱它?

我已经尝试过清理构建文件夹,擦除模拟器的所有内容和设置,尝试了不同的模拟器以及再次关闭和启动 Xcode。

Details

Could not attach to pid : “3386”
Domain: IDEDebugSessionErrorDomain
Code: 3
Failure Reason: lost connection
User Info: {
    DVTRadarComponentKey = 855031;
    RawUnderlyingErrorMessage = "lost connection";
}
--


System Information

macOS Version 12.0 (Build 21A5304g)
Xcode 12.5.1 (18212) (Build 12E507)
Timestamp: 2021-08-25T12:20:16+05:00

【问题讨论】:

    标签: ios swift xcode ios-simulator


    【解决方案1】:

    这可能是授权问题,请在终端中尝试以下行。

    sudo DevToolsSecurity -enable

    【讨论】:

    • 已经尝试过了,我的问题没有任何改变。
    【解决方案2】:

    此问题可能与您使用的 macOS 测试版有关。

    我建议开发人员使用 Apple 的 Xcode 13 Beta。 您需要一个免费的 Apple 开发者帐户才能访问此下载。

    对我来说,这解决了所有问题。

    【讨论】:

      【解决方案3】:

      取消选中调试可执行文件。

      编辑方案 > 运行 > 调试可执行文件

      【讨论】:

        【解决方案4】:

        在控制台中收到此错误:

        com.apple.debugserver) may not get the task control port of (appName) (pid: 1976): (appName) is hardened, (appName) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger(com.apple.debugserver) is not a declared read-only debugger

        将调试级别的CODE_SIGN_INJECT_BASE_ENTITLEMENTS 的构建设置设置为YES。

        【讨论】:

          猜你喜欢
          • 2017-11-22
          • 1970-01-01
          • 2016-09-04
          • 1970-01-01
          • 2015-07-11
          • 2016-10-01
          • 1970-01-01
          • 1970-01-01
          • 2016-10-31
          相关资源
          最近更新 更多