2

I have written a Siri Intents extension (#1) with a corresponding IntentsUI extension (#2). Both are working.

To debug the Intents extension (#1), I can just cmd-R for the Intents Extension scheme (with the scheme executable set to "Ask On Launch"), it runs and attaches to the debugger, as expected (also answered here).

After the Intents extension (#1) completes, the Intents UI extension (#2) runs and displays, again as expected, but it does NOT attach to the debugger.

I thought maybe I could use the same type of scheme setup for the IntentsUI extension (#2) as with Intents extension (#1), but this fails to launch at all.

I see no way to get the IntentsUI extension (#2) to attach in the debugger and allow stepping through the code.

Paul King
  • 1,881
  • 20
  • 23
  • Possible duplicate of [How do I debug my Siri (Intents) extension?](https://stackoverflow.com/questions/38093871/how-do-i-debug-my-siri-intents-extension) – Sarp Başaraner Oct 05 '18 at 10:25
  • @SarpBaşaraner I edited the question to try to make it clear that this is not a duplicate of the question you mentioned - that question is talking about a Siri Intent extension. This question is about a Siri Intent *UI* extension. Two different (but related) things, which is why I mention the former in this question. – Paul King Oct 05 '18 at 17:53

2 Answers2

4

A bit more work and I figured it out:

The solution is to setup the IntentsUI scheme to the following:

  1. "Executable" = IntentsUI.appex
  2. "Debug Executable" is checked
  3. "Launch" is set to "Wait for executable to be launched"

Now, when you build and run (cmd-R), the debugger will wait for the Intents UI extension to attach. Set a break point in configureView().

At this point you can switch to the Intents scheme, then build and run. When the Siri intent completes, the intentUI will execute, attach to the debugger, and stop at the break point you had previously set.

Paul King
  • 1,881
  • 20
  • 23
  • I've tried following, the debugger crashed with `Message from debugger: Terminated due to signal 9`. No breakpoint stopped. – Eddie Mar 09 '22 at 09:52
0

A bit more work and I figured it out:

The solution is to setup the IntentsUI scheme to the following:

  1. "Executable" = Ask on Lunch
  2. "Launch" is set to "Wait for executable to be launched" Now, when you build and run (cmd-R), the debugger will wait for the Intents UI extension to attach. Set a break point in configureView().

At this point you ask Hey siri to your execute the intent, then the break point will stopped when it's configuring the view in the func configureView(for: of: interactiveBehavior: context: completion:)

Eddie
  • 1,903
  • 2
  • 21
  • 46