14

I've written a very simple Safari Content Blocker and wrapper app. However, I'm at a loss as to how to go about debugging it. I've tried running the wrapper app and then running Safari, both within the iOS simulator. However, I do not see my content blocker being applied. (And, yes, I've enabled it in Settings->Safari) I've added NSLog() methods to my beginRequest(with context: NSExtensionContext) method, but do not see them written to the logs. I've tried adding breakpoints in this method, and Xcode never stops on them. So, it's clear to me that either my content blocker is not being installed properly, or I'm not debugging it properly.

Can anyone give me some guidance as to how to debug this extension?

Shadowman
  • 11,150
  • 19
  • 100
  • 198
  • 3
    Don't have any experience with creating a Content Blocker Extension, but when creating other types of extensions (Today, Keyboard and Notification Content extensions), in order to be able to debug you have to build and run the extension target and not the wrapper app. Running the wrapper app will show you the extension working but you'll never hit any breakpoints you set. – Simo May 24 '17 at 12:38
  • 1
    for me in safari still not working (debug) – Fabiosoft Nov 07 '18 at 15:45
  • @Simo By building the wrapper app, breakpoints in the Swift code for the extension are hit, and the extension stops executing, but I'm not getting any output from it (`print`/`NSLog`) – Andreas is moving to Codidact Dec 06 '19 at 08:04

0 Answers0