Safari Web inspector keeps disconnecting

前端 未结 15 961
醉话见心
醉话见心 2021-01-30 10:27

I\'ve Safari 8.0.6 with iOS 8.3 on my iPad, while debugging through Web Inspector on my Mac (10.10.3), the connection keeps on

15条回答
  •  一生所求
    2021-01-30 10:48

    There are a few things to try:

    1. Test on the Xcode Simulator:

    Open the iPhone simulator in Xcode and debug there with Safari Web Inspector.

    Sidenote: Maybe you need to download the Safari Technology Preview

    2. Reset your location and privacy settings on your device.

    Settings > General > Reset > Reset Location & Privacy

    3. Debugging on a real device

    With this configuration it seems to work right now.

    iPhone X, iOS Version 12.1.3 macOS Mojave Version 10.14.2 (18C54) Safari Version 12.0.2 (14606.3.4)

    Edit 2019.08.13

    Settings -> Safari -> Advanced -> Check that Webinformation is toggled on.

    It was suddenly toggled off and I couldn't connect via the Web Inspector. After toggling it on, it worked.

    For other devices / versions, please read further down (Maybe you can decrease your build size).


    EDIT: 2018.09.20

    @Chet found out, the Web Inspector keeps disconnecting for too large JS files and map files

    https://stackoverflow.com/a/52338231/4641479

    Issue on Github:

    https://github.com/google/ios-webkit-debug-proxy/issues/275

    https://github.com/google/ios-webkit-debug-proxy/issues/274

    I could confirm this on a real device with a production build (1.8 MB + 2.4 MB files), the Safari Web Inspector stays always connected.

    Since for the development build it is not:


    Before my web inspector very rarely worked and often just stopped working - but was still open. After the safari update the web inspector opens and closes immediately. If you encounter such problems..

    This will work:

    Step 1. Get the latest Safari Browser

    Safari: 11.1 (12605.1.33.1.2)

    https://developer.apple.com/safari/download

    macOS Sierra and OS X El Capitan (I assume macOS high Sierra is also supported)

    Maybe you need to download the Safari Technology Preview


    Step 2. Reset your location and privacy settings

    On your device go to:

    Settings > General > Reset > Reset Location & Privacy

    Source: https://forums.developer.apple.com/thread/87181


    Step 3. Connect your device

    Open Safari on OS X If you had connected your iPhone device with an usb cable, disconnect it first. Now plug it in.

    On OS X Safari go to:

    Develop > Device name > Apply for development

    Now on your phone there is a permission question. Choose trust and now you can choose the open tab on your devices safari and debug.


    Happy debug!

    Now the web inspector stays connected.

提交回复
热议问题