iosswiftxcodesirikitintents-extension

When running the IntentsExtension, how can I also debug the main app?


I'm trying to implement the StartCallIntent in my app. The intent first goes through the extension to resolve contacts, determine if the app can handle the intent, etc.. So far, I have the extension part working, and I'm able to debug it. However, once the extension has finished handling it, the extension will then open the main app to continue the call flow:

let userActivity = NSUserActivity(activityType: NSStringFromClass(INSendMessageIntent.self))
completion(INStartCallIntentResponse(code: .continueInApp, userActivity: userActivity))

At that point, I am unable to set breakpoints or see any logs from the main app process. I only see the extension logs / breakpoints getting triggered. How can I also make it so the main app is debug-able?


Solution

  • The run scheme for the Intent Extension has some additional options for running. One of those options includes a checkbox that says Debug executable. If you check that box, then xcode will also respect any breakpoints set in the main app, as well as emit any logs from the main app. Make sure you have your app selected under "Executable" as well!

    enter image description here