Safari Web检查器不断断开连接 [英] Safari Web inspector keeps disconnecting

查看:231
本文介绍了Safari Web检查器不断断开连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iPad上使用 iOS 8.3 Safari 8.0.6 ,同时在 Mac(10.10.3)上通过Web Inspector进行了调试。 >,连接会继续断开(断开连接后,我在开发菜单下看不到设备名称),但如果我退出safari之后又重新启动,则可以恢复,然后可以刷新并再次进行远程检查。

解决方案

可以尝试一些方法:


1。在Xcode模拟器上进行测试:



在Xcode中打开iPhone模拟器并使用Safari Web Inspector进行调试。


边注:也许您需要下载


因为用于开发版本,所以不是:


< img src = https://i.stack.imgur.com/Oox3U.png alt =在此处输入图片描述 />




在我的Web检查员很少工作之前,常常只是停止工作-但仍然处于打开状态。 Safari浏览器更新后,Web检查器将打开并立即关闭。如果遇到此类问题。


这将起作用:


步骤1。获取最新的Safari浏览器


Safari:11.1(12605.1.33.1.2)


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


macOS Sierra和OS X El Capitan(我假设还支持macOS high Sierra)


也许您需要下载 Safari技术预览版




步骤2。重置您的位置和隐私设置


在设备上转到:


设置>一般>重置>重置位置和隐私权


来源: https ://forums.developer.apple.com/thread/87181




步骤3。连接设备


在OS X
上打开Safari如果您已使用USB电缆连接了iPhone设备,请先断开其连接。
现在将其插入。


在OS X Safari上:


开发>设备名称>申请开发


您的手机上现在有一个权限问题。选择信任,现在您可以选择设备上的野生动物园并进行调试了。




祝您调试愉快!


现在,Web检查器保持连接状态。


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 disconnecting (I don't see the device name under Develop menu upon disconnection) but can resume if I quit safari followed by a relaunch then I'm able to refresh and inspect remotely again.

解决方案

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.

这篇关于Safari Web检查器不断断开连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆