问题描述
当我在iOS扩展中调试代码时。我在EXC_BREAKPOINT
时遇到了一些崩溃
我做了什么?
- 使用Xcode 11.5运行我的APP。
- 开始调试扩展程序:
Debug
->Attach to Process by PID or name
->Input my Extension name and click Attach Button
- 在
Extension code
中设置一些断点(我的位置是UNNotificationServiceExtension
) - 最小化APP。
- 推送通知。
- 触发我设置的断点。
- 继续调试。然后我看到了这次崩溃。
我的问题是在我的情况下如何调试扩展程序?
解决方法
这可能是Xcode的错误。我通过在第二时间推送通知中设置断点来修复它。 因此,步骤如下:
- 使用Xcode 11.5运行我的APP。
- 开始调试扩展程序:
Debug
->Attach to Process by PID or name
->Input my Extension name and click Attach Button
- 最小化APP。
- 确保扩展代码中没有断点。
- 推送通知。
- 在
Extension code
中设置一些断点(我的位置是UNNotificationServiceExtension
) - 推送通知。
- 触发我设置的断点。
- 继续调试。效果很好。