Xcode cannot attach debugger to NotificationServiceExtension on iOS 11

Viewed 1517

When trying to debug a UNNotificationServiceExtension on a iOS 11 device, Xcode is unable to attach properly to the Extension process, and the process itself gets killed by Springboard before it can intercept and handle the received notification.

This always occurs when running the Scheme created by Xcode to debug the Extension. When debugging the app normally (with the "main" app scheme), the NotificationServiceExtension runs fine and intercepts the notifications (but it can't be debugged).

The following logs appear on the device console:

error SpringBoard [com.acme.notification] Extension will be killed due to sluggish startup

error SpringBoard Hub connection error Error Domain=NSCocoaErrorDomain Code=4097 "connection to service named com.acme.notification" UserInfo={NSDebugDescription=connection to service named com.acme.notification}

Sometimes, Xcode also pops an error dialog when receiving a notification (right when the debugger should attach):

Could not attach to pid : “{PID NUMBER}”

Ensure “com.acme.notification” is not already running, and {USER} has permission to debug it.

Note that on a device running iOS 10 this is working just fine, the Extension is given the chance to handle the notification, and the debugger will attach and break in the extension code normally.

Is there something I'm missing here or is this a bug I should report to Apple? Anyone having the same behavior?

0 Answers
Related