ios 有没有办法在任何IOS设备上调试chrome
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/38179396/
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
Is there any way to debug chrome in any IOS device
提问by Alexander Gorelik
Is there any way to debug chrome browser on IOS device?
有没有办法在IOS设备上调试chrome浏览器?
If there is no way, how i can approach to bug in chrome on ios?
如果没有办法,我如何处理 ios 上的 chrome 中的错误?
Searched the web and didn't find sufficient answer.
在网上搜索并没有找到足够的答案。
采纳答案by Gideon Pyzer
Old Answer (July 2016):
旧答案(2016 年 7 月):
You can't directly debug Chrome for iOS due to restrictions on the published WKWebView
apps, but there are a few options already discussed in other SO threads:
由于对已发布WKWebView
应用程序的限制,您无法直接为 iOS 调试 Chrome ,但在其他 SO 线程中已经讨论了一些选项:
If you can reproduce the issue in Safari as well, then use Remote Debugging with Safari Web Inspector. This would be the easiest approach.
WeInReallows some simple debugging, using a simple client-server model. It's not fully featured, but it may well be enough for your problem. See instructions on set up here.
You could try and create a simple
WKWebView
browser app (some instructions here), or look for an existing one on GitHub. Since Chrome uses the same rendering engine, you could debug using that, as it will be close to what Chrome produces.
如果您也可以在 Safari 中重现该问题,请使用Safari Web Inspector 进行远程调试。这将是最简单的方法。
WeInRe允许使用简单的客户端-服务器模型进行一些简单的调试。它的功能不全,但可能足以解决您的问题。请参阅此处的设置说明。
您可以尝试创建一个简单的
WKWebView
浏览器应用程序(这里有一些说明),或者在 GitHub 上查找现有的应用程序。由于 Chrome 使用相同的渲染引擎,您可以使用它进行调试,因为它将接近 Chrome 生成的内容。
There's a "bug" opened up for WebKit: Allow Web Inspector usage for release builds of WKWebView. If and when we get an API to WKWebView
, Chrome for iOS would be debuggable.
WebKit 有一个“错误”:允许 Web Inspector 用于 WKWebView 的发布版本。如果我们获得 API 到WKWebView
,iOS 版 Chrome 将是可调试的。
Update January 2018:
2018 年 1 月更新:
Since my answer back in 2016, some work has been done to improve things.
自从我在 2016 年回答以来,已经做了一些工作来改进事情。
There is a recent project called RemoteDebug iOS WebKit Adapter, by some of the Microsoft team. It's an adapter that handles the API differences between Webkit Remote Debugging Protocol and Chrome Debugging Protocol, and this allows you to debug iOS WebViews in any app that supports the protocol - Chrome DevTools, VS Code etc.
最近有一个名为RemoteDebug iOS WebKit Adapter 的项目,由 Microsoft 团队的一些成员开发。它是一个适配器,用于处理 Webkit 远程调试协议和 Chrome 调试协议之间的 API 差异,这允许您在任何支持该协议的应用程序中调试 iOS WebViews - Chrome DevTools、VS Code 等。
Check out the getting startedguide in the repo, which is quite detailed.
查看repo 中的入门指南,它非常详细。
If you are interesting, you can read up on the background and architecture here.
如果您感兴趣,可以在此处阅读背景和架构 。
回答by MikecheckDev
If you don't need full debugging support, you can now view JavaScript console logs directly within Chrome for iOS at chrome://inspect.
如果您不需要完整的调试支持,您现在可以直接在 Chrome for iOS 中查看 JavaScript 控制台日志,网址为 chrome://inspect。
https://blog.chromium.org/2019/03/debugging-websites-in-chrome-for-ios.html
https://blog.chromium.org/2019/03/debugging-websites-in-chrome-for-ios.html