14

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?

dogsgod
  • 6,267
  • 6
  • 25
  • 53

4 Answers4

19

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/

jianpx
  • 3,190
  • 1
  • 30
  • 26
  • 2
    This is probably the right way to start - at least some parts do work now. But still I can not debug - I'm debugging the host app with this setup, not the extension! – dogsgod Aug 05 '16 at 09:27
  • You need to Attach to Process by PID or Name. Enter the name of you extension before starting the debug. At least in the days of Xcode 8 beta 4 this used to work – dogsgod Aug 16 '18 at 14:41
  • You can also edit your Intent extension's scheme with a Siri Intent Query to avoid having to speak to your phone each time you need to debug something. – Sarp Başaraner Mar 29 '19 at 12:49
9
  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.

Venu Gopal Tewari
  • 5,672
  • 42
  • 41
  • 1
    In step 2, when I select my app from the list instead of Siri, it just starts my app and never starts Siri. – User Jul 29 '18 at 19:04
  • ^^^ same thing happens to me, just launches the app - my handler is never run. it's listed in the extension's plist as the handler. my breakpoints never hit and print statements never print. – powerj1984 Aug 15 '19 at 19:02
0

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

wlixcc
  • 1,132
  • 10
  • 14
-1

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.

Tiago Mendes
  • 4,572
  • 1
  • 29
  • 35