Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 10: How to debug a Today Widget - "Unable to load" message

It seems to me that whenever a Today Widget crashes for any reason it displays the "Unable to load" message (as on the attached screen).

When this happens nothing kicks off in the debugger, nothing appears on the Console. It seems to me like searching for a needle in the haystack. Is it possibl to debug the "Unable to load" message in Xcode in any way?

Xcode version: 8.2

iOS Simulator: 10.2

Unable to load

like image 695
adamsfamily Avatar asked Dec 27 '16 15:12

adamsfamily


People also ask

How do I debug a current extension?

You can debug you Today Extension by doing the following: With the application running in your device/simulator, open the widget. Then, when you have your widget open, go to Xcode->Debug->Attach to Process and you should find your widget name. Note this will only work if you have your widget opened.

How do I enable debug mode in Xcode?

When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.


1 Answers

You can debug you Today Extension by doing the following:

With the application running in your device/simulator, open the widget. Then, when you have your widget open, go to Xcode->Debug->Attach to Process and you should find your widget name.

Note this will only work if you have your widget opened. You can set breakpoints and debug step by step to find out why the "Unable to Load" message appears.

like image 117
J Curti Avatar answered Sep 16 '22 17:09

J Curti