2

Using Safari Web Inspector on a WebKit based app stopped working on iOS 16.4.

This was properly working before.

More specifically, using the iOS Simulator or a real device, debugging a WebKit based app and from Safari on macOS accessing the Develop to inspect the app.

No difference at all if it is the Simulator or a real device; none seem to work, but inspecting iOS-Safari from macOS-Safari works as expected.

I already tried deleting and reinstalling the app, erasing the simulator, etc.

JeremyP
  • 84,577
  • 15
  • 123
  • 161
vicegax
  • 4,709
  • 28
  • 37

2 Answers2

3

There is a new property isInspectable on WKWebView, false by default but turning it on will enable the inspector.

This works both for iOS and macOS, no need for the old way of using KVO on macOS with developerExtrasEnabled anymore.

Available

  • iOS 16.4
  • macOS 13.3

Turning it on

wkWebView.isInspectable = true
vicegax
  • 4,709
  • 28
  • 37
0

If you don't want to update your macOS or xcode try this

if webView.responds(to: Selector(("setInspectable:"))) {
    webView.perform(Selector(("setInspectable:")), with: true)
}

This worked for me on XCode -> 14.2 (14C18) macOS -> 13.4 (22F66)

Ref -> https://stackoverflow.com/a/76603043/12150745