skip to Main Content

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.

2

Answers


  1. Chosen as BEST ANSWER

    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
    

  2. 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

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search