0

When I debug the code in iOS Extension. I face some crash with EXC_BREAKPOINT

What did I do?

  1. Run my APP with Xcode 11.5.
  2. Start debugging for extension: Debug -> Attach to Process by PID or name -> Input my Extension name and click Attach Button
  3. Setup some breakpoint in Extension code (Mine is UNNotificationServiceExtension)
  4. Minimize the APP.
  5. Push the notification.
  6. Trigger the breakpoint which I set.
  7. Continue to debug. Then I see this crash.

My question is how to debug extension in my case?

Yanni
  • 580
  • 2
  • 6
  • 21

1 Answers1

2

It may be a bug from Xcode. I fix it by setting breakpoint at the SECOND time push notification. So the steps are:

  1. Run my APP with Xcode 11.5.
  2. Start debugging for extension: Debug -> Attach to Process by PID or name -> Input my Extension name and click Attach Button
  3. Minimize the APP.
  4. Make sure there is no breakpoint in extension code.
  5. Push the notification.
  6. Setup some breakpoint in Extension code (Mine is UNNotificationServiceExtension)
  7. Push the notification.
  8. Trigger the breakpoint which I set.
  9. Continue to debug. It works fine.
Yanni
  • 580
  • 2
  • 6
  • 21