dogsgod
dogsgod

Reputation: 6387

How do I debug my Siri (Intents) extension?

I'm building a Siri aka Intents extension. I do understand that I can attach the debugger to a running process after start, however, I never see my process. I do have the authorization for my app set to active and the extension must be running at least for some time, Siri is showing clear responses.

By the Apple documentation, you should run the Extension Scheme with Siri as host app. However, if I try that nothing happens on the device, it's waiting to attach for ever. Apple mentions the first connection can take "several minutes", but not hours ...

Any idea where I'm going wrong or how to achieve a connection to the debugger? Or at least some console output?

Upvotes: 16

Views: 10203

Answers (4)

wlixcc
wlixcc

Reputation: 1492

In my case, Xcode 13.X, iOS15

  1. Change target to you intent extension

  2. Run extension and choose your App

    enter image description here

  3. After App launch, trigger your shortcut(you can use Siri or just tap shortcut)

  4. You will see your breakpoints working inside Intent Handler

enter image description here

Upvotes: 0

Tiago Mendes
Tiago Mendes

Reputation: 5166

I tried all the ways and it didn't work I think it's because I have a mac too old (2010) and has no ability to process.

This is a very hack solution to debug but it works.

Create a webhook using this site https://webhook.site

Then if you want to check if you code was in some point just add this code: (Don't forget to change the URL for the same that you received webhook)

let url1 = URL(string: "https://webhook.site/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/your_code_was_here")!
let task1 = URLSession.shared.dataTask(with: url1)
task1.resume()

Then you just need to look again at the webhook site to see if the GET request got there.

Upvotes: -1

Venu Gopal Tewari
Venu Gopal Tewari

Reputation: 5876

  1. Run your app in device first.

  2. Select SIRIKIT extension scheme run in your device, select your app from the list prompted.

  3. Wait for SIRI to be active, send your running SIRIKIT extension into background.(Some times you need not to do this step also).

  4. Activate SIRI by pressing home button again, give a command and you will see your breakpoints working inside Intent Handler.

Upvotes: 8

jianpx
jianpx

Reputation: 3330

just select your siri extension scheme and hit run button, then xcode will prompt a list of applications for you to choose, just choose your app, for more details, please checkout the article:http://jamesonquave.com/blog/adding-siri-to-ios-10-apps-in-swift-tutorial/

Upvotes: 20

Related Questions