在 iOS 8 和 iOS 9 中调试移动 Safari

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26014850/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 02:45:29  来源:igfitidea点击:

Debugging mobile Safari in iOS 8 and iOS 9

iosiphonesafarimobile-safari

提问by jollelj

After switching to new versions of iOS, I've not been able to debug my web app from OS X Safari to my iPhone Safari browser. My iPhone shows up but I get no options.

切换到新版本的 iOS 后,我无法将我的 Web 应用程序从 OS X Safari 调试到我的 iPhone Safari 浏览器。我的 iPhone 出现了,但我没有选择。

On my iPhone, I have allowed the web inspector.

在我的 iPhone 上,我已经允许网络检查器。

English: Developer ->Johans iPhone ->No inspectable applications

中文:开发人员 ->Johans iPhone ->没有可检查的应用程序

English: Developer -> Johans iPhone -> No inspectable applications.

英语:Developer -> Johans iPhone -> 没有可检查的应用程序。

If I, however save my web app to my home screen - I can get the developer tools for that app, but it's not what I want at this occasion. Unfortunately I have no other iOS / OS X devices to test with, so any help would be greatly appreciated.

但是,如果我将我的网络应用程序保存到我的主屏幕 - 我可以获得该应用程序的开发人员工具,但这不是我现在想要的。不幸的是,我没有其他 iOS / OS X 设备可以测试,所以任何帮助将不胜感激。

采纳答案by Josh

Debugging iOS 8 mobile Safari requires desktop Safari 7.1, which is only available with OS X 10.9.5 or greater.

调试 iOS 8 移动版 Safari需要桌面版 Safari 7.1,它仅适用于 OS X 10.9.5 或更高版本

What you need to do is:

你需要做的是:

  1. Update (via Apple menu->Software Update) to OS X 10.9.5 (if you haven't already)
  2. Once you've done that, you should see the Safari 7.1 in the list of pending updates
  1. 更新(通过 Apple 菜单->软件更新)到 OS X 10.9.5(如果你还没有)
  2. 完成此操作后,您应该会在待定更新列表中看到 Safari 7.1

Once done, you should see be able to debug as usual via desktop Safari.

完成后,您应该可以像往常一样通过桌面 Safari 进行调试。

回答by tabrindle

Though this is an old question, it should be mentioned somewhere in the answer that you actually have to enable remote inspection on the iPhone first before anything will show up.

尽管这是一个老问题,但应该在答案中的某处提到您实际上必须先在 iPhone 上启用远程检查,然后才能显示任何内容。

Go to: Settings --> Safari --> Advanced --> Web Inspector

转到:设置 --> Safari --> 高级 --> Web Inspector

Enable Web Inspector

启用网络检查器

回答by Steve Seeger

Also for iOS 9:

也适用于 iOS 9:

On your mobile device under Settings -> Safari -> Fraudulent Website Warning = OFF [default = ON]

在您的移动设备上的设置 -> Safari -> 欺诈网站警告 = 关闭 [默认 = 开启]

回答by mediafreakch

Even with OS X 10.9.5 and Safari > 7.1 I wasn't able to debug mobile Safari on an iPad with iOS 8.

即使使用 OS X 10.9.5 和 Safari > 7.1,我也无法在装有 iOS 8 的 iPad 上调试移动版 Safari。

It turned out that I had previously rejected a dialog on the iPad that asked whether to "trust this computer". The following steps helped:

原来我之前在 iPad 上拒绝了一个询问是否“信任这台电脑”的对话框。以下步骤有所帮助:

  1. Power down device.
  2. Open iTunes on computer.
  3. Connect device to computer.
  4. Respond to computer question to let device access iTunes.
  5. Turn on device.
  1. 关闭设备。
  2. 在电脑上打开 iTunes。
  3. 将设备连接到计算机。
  4. 回答计算机问题以让设备访问 iTunes。
  5. 打开设备。

It will ask you to confirm to trust the computer again. Accept and you should be able to debug as usual.

它会要求您再次确认信任计算机。接受,您应该可以像往常一样进行调试。