ios-app-extensionsirikit

Is there any way to use the debugger with Siri Intents *UI* extension?


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.


Solution

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