javascript 如何连接到 iPhone 的 webkit 调试器?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14280536/
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-10-26 21:12:50  来源:igfitidea点击:

How to connect to iPhone's webkit debugger?

javascriptdebuggingios6remote-debuggingweb-inspector

提问by Jan

new iOS 6 feature is, that you can debug html and javascript running on device or simulator in desktop safari. I suppose, that this feature is based on Webkit Remote Debugging Protocol.

iOS 6 的新功能是,您可以在桌面 safari 中调试设备或模拟器上运行的 html 和 javascript。我想,这个功能是基于Webkit 远程调试协议的

How can I connect to webkit running on iPhone without desktop Safari?

如何在没有桌面 Safari 的情况下连接到在 iPhone 上运行的 webkit?

I can do this for mobile Chrome running on Android using websockets, but how can I do that for iOS devices?

我可以使用 websockets 为在 Android 上运行的移动 Chrome 执行此操作,但如何为 iOS 设备执行此操作?

采纳答案by Chris Lundie

The ios-webkit-debug-proxyproject (from Google!) does this.

IOS-WebKit的调试代理的项目(从谷歌!)做到这一点。

回答by Andy Davies

You want to look at this code https://github.com/leftlogic/remote-debug/tree/master/safari- although it fails when it actually comes to RPC calls that use __rpc_forwardSocketData.

您想查看此代码https://github.com/leftlogic/remote-debug/tree/master/safari- 尽管在实际涉及使用 __rpc_forwardSocketData 的 RPC 调用时它失败了。

If you've got any ideas why several of us are interested!

如果您有任何想法,为什么我们中的几个人感兴趣!

回答by Andre Zimpel

You need to open up the iPhone Simulator and browse to a website.

您需要打开 iPhone 模拟器并浏览到一个网站。

Then open Safari and choose "Develop" from the menubar. There is a the option called "iPhone Simulator".

然后打开 Safari 并从菜单栏中选择“开发”。有一个名为“iPhone Simulator”的选项。

If you hover over this you can see all of the open websites of the simulator.

如果将鼠标悬停在此上方,您可以看到模拟器的所有打开网站。

This gives you the same inspector Safari uses. You can even see hovered elements in the iPhone Simulator.

这为您提供了与 Safari 相同的检查器。您甚至可以在 iPhone 模拟器中看到悬停的元素。