Debug Notification Extensions

前端 未结 9 854
感动是毒
感动是毒 2020-12-08 19:10

I\'m building a set of Notification Extensions (Service/Content). I\'m unable to connect to Xcode debugger or even log out to the device log or console.

Is there any

相关标签:
9条回答
  • 2020-12-08 19:51

    In my case all methods above had some mistakes. Main point, that you need to send push one time, then connect through debugger, then send push to debug. So, full list:

    1. Launch app (not extension).

    2. Stop app from XCode.

    3. Send one push.

    4. Connect via "Attach to Process by PID or Name..." to your extension process.

    5. Send another push.

    0 讨论(0)
  • 2020-12-08 19:57

    Notification service extension (NSE) is not actually a part of your app but an extension that said it has a different process id (PID) from your app. You can have XCode listen to every process on your phone by going to the “Debug” tab, scroll down to “Attach to Process” and look to see if your NSE is listed under “Likely Targets”. If it's not there than try to sand another push notification to your device and attach to it when it appears.

    Now in debug navigator you can see the NES process and you can successfully debug it.

    0 讨论(0)
  • 2020-12-08 19:59

    The only way that worked for me was to see logs. I use xcode 10.1. The logs were available from Window -> Devices and Simulators -> Choose your device -> click on 'Open Console'. This way i could see logs from extensions as well.

    0 讨论(0)
提交回复
热议问题