使用某些断点进行调试时,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. 继续调试。效果很好。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...