使用某些断点进行调试时,iOS Extension中的EXC_BREAKPOINT崩溃

问题描述

当我在iOS扩展中调试代码时。我在EXC_BREAKPOINT 时遇到了一些崩溃

我做了什么?

  1. 使用Xcode 11.5运行我的APP。
  2. 开始调试扩展程序:Debug-> Attach to Process by PID or name-> Input my Extension name and click Attach Button
  3. Extension code中设置一些断点(我的位置是unnotificationserviceextension
  4. 最小化APP。
  5. 推送通知
  6. 触发我设置的断点。
  7. 继续调试。然后我看到了这次崩溃。

我的问题是在我的情况下如何调试扩展程序?

解决方法

这可能是Xcode的错误。我通过在第二时间推送通知中设置断点来修复它。 因此,步骤如下:

  1. 使用Xcode 11.5运行我的APP。
  2. 开始调试扩展程序:Debug-> Attach to Process by PID or name-> Input my Extension name and click Attach Button
  3. 最小化APP。
  4. 确保扩展代码中没有断点。
  5. 推送通知。
  6. Extension code中设置一些断点(我的位置是UNNotificationServiceExtension
  7. 推送通知。
  8. 触发我设置的断点。
  9. 继续调试。效果很好。