8

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?

Jackson
  • 3,555
  • 3
  • 34
  • 50
  • possible duplicate of [How to debug iOS 8 extensions with NSLog?](http://stackoverflow.com/questions/24031612/how-to-debug-ios-8-extensions-with-nslog) – Andrew Aug 21 '14 at 20:05

7 Answers7

13

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).

frankish
  • 6,738
  • 9
  • 49
  • 100
  • 1
    I'm going to mark this as the correct answer because I think that it has been working okay since I've been following a sort of slow and non aggressive approach but sadly it still seems a bit buggy and less forgiving than Apple dev tools should be. – Jackson Sep 29 '14 at 14:27
  • closing the today before compiling really solves the problem. – João Nunes May 28 '16 at 11:23
1
  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.
FernandoEscher
  • 2,940
  • 2
  • 28
  • 27
1

Close the notification window. It should start working.

user1140780
  • 988
  • 2
  • 13
  • 29
0

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.

BalestraPatrick
  • 9,944
  • 4
  • 30
  • 43
  • Somehow it started working again, I have no idea. I was basically doing this all along. A reboot of your mac, and phone might help. – Jackson Sep 16 '14 at 00:28
0

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.

PhilB
  • 83
  • 1
  • 8
0

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

Bobo Shone
  • 721
  • 6
  • 16
0
  1. Delete the app from your phone
  2. Run the today widget scheme

It worked for me.

lhmgrassi
  • 131
  • 2
  • 6