iOS 8 beta 5 Today view extension (widget) stuck a

2019-03-27 05:21发布

问题:

I want to debug a today view extension (widget) in iOS 8, so I select the widget under "Scheme" in Xcode, and select my iPhone as the device and hit run. It says "running today-view on iPhone" and on the side bar on the left it says "Waiting to attach". It gets tuck at the "waiting to attach" phase forever and never shows me any debugging info on my iPhone. However this works fine if I select the simulator as my device. After a few seconds of "waiting to attach" in the simulator, the widget comes alive and debugging info is displayed.

Has anybody come across why an extension won't show debugging info on an iPhone but will in the simulator?

回答1:

Do not stop & start the debugger while notification windows is open in the simulator. Close the notification window. Stop the debugger. Start it again. Debugging widget in iOS8 is very delicate. You need to do everything in a slow non-agressive way (for now).



回答2:

  1. Edit the extension scheme and make sure that under Run, the Executable option is set to Ask on Launch.
  2. Run the extension scheme.
  3. From the list, select the Today executable.
  4. It should launch the Today app and your extension should be attached to the debugger now.


回答3:

Close the notification window. It should start working.



回答4:

I've been able to debug my Today view extensions in this way.

1) Make sure the notification center is dismissed.

2) Stop every process in Xcode with the stop button.

3) Run the extension scheme

4) Pull down the notification center and should hear the usual "app launched" sound from Xcode

5) Debugger will be attached automatically and you'll be able to debug the extension.

Let me know if this works for you.



回答5:

This happened to me .... Looks like you were doing everything right .... try all the above. The problem went away when I unplugged and re-plugged in my Phone.



回答6:

Sometimes click on the widget will fire the running of extension.



回答7:

  1. Delete the app from your phone
  2. Run the today widget scheme

It worked to me.