How Can I Debug With WidgetKit Extension?

When I develop My WidgetKit Extension,I set some breakpoints for my code In the App Target And Extension Target ,It don't work,Who can help me solve this problem? Thank you!

Accepted Reply

Have you tried running the extension scheme?

Replies

Have you tried running the extension scheme?
you can also click on debug menu -> attach to process
Thank you for everyone!
I have solved this problem after updating my Xcode, maybe this is the bug of Xcode 12 Bate 2.

If Updating Don't work, do the setup below:
  1. running the extension scheme

  2. click on debug menu -> attach to process

I was running the extension scheme and still not seeing breakpoints or print statements. I got it to work by having the widget extension running, and then running the application scheme.

Add a Comment