135

Is there any way to debug chrome browser on IOS device?

If there is no way, how i can approach to bug in chrome on ios?

Searched the web and didn't find sufficient answer.

Alexander Gorelik
  • 3,985
  • 6
  • 37
  • 53
  • 1
    Please provide some useful details of what your issue is. a "bug in chrome" could mean anything. A crash inside the application, an alignment issues with html / css, javascript not working correctly. Depending what your specific issue, there will be different ways to help – Simon McLoughlin Jul 04 '16 at 08:23
  • Just be aware that the site you're debugging has to run over http. You won't see any output if you are looking at a site whose URL begins "https://". – Andrew Wiseman Aug 01 '20 at 16:07

2 Answers2

171

If you don't need full debugging support, you can now view JavaScript console logs directly within Chrome for iOS at chrome://inspect.

https://blog.chromium.org/2019/03/debugging-websites-in-chrome-for-ios.html

Chrome for iOS Console

MikecheckDev
  • 2,176
  • 2
  • 15
  • 6
75

Old Answer (July 2016):

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:

  1. If you can reproduce the issue in Safari as well, then use Remote Debugging with Safari Web Inspector. This would be the easiest approach.

  2. WeInRe allows 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.

  3. 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.

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.

Update January 2018:

Since my answer back in 2016, some work has been done to improve things.

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.

Check out the getting started guide in the repo, which is quite detailed.

If you are interesting, you can read up on the background and architecture here.

Gideon Pyzer
  • 22,610
  • 7
  • 62
  • 68
  • 1
    Hi There Thanks for the answer. Currently i am working on ios extension app which is used for password autofill , in this some js file is used so here how can debug those js file? If you have any idea then please know me as i am stucking in the debugging – Anita Nagori Jan 22 '18 at 08:13
  • 1
    @Anita I've updated my answer as it was a little old. Check out the adapter project, as I think this allow you to debug the JS in your app. – Gideon Pyzer Jan 22 '18 at 22:28
  • Just wanted to point out that the updated answer is a follow up of option 3 of the old answer. Debugging chrome directly with this adapter is not possible. – marsman May 23 '18 at 16:33
  • @GideonPyzer What's the point of this question? Couldn't you just set the device to iphone 6 or whatever on Google Chrome on your laptop? – Gwater17 May 31 '18 at 17:44
  • 3
    The RemoteDebug iOS WebKit Adapter is cool. It lets you use Chrome DevTools or other desktop debuggers for sites on your mobile device. But I have not been able to get it to attach to sites on mobile Chrome for iOS - only mobile Safari. Unfortunately, they are displaying different behaviors on a site that I'm working on. And those behaviors only appear on mobile Chrome - not on Chrome Dev Tools in mobile emulation mode. Might have to hack together some sort of console window on the site to figure it out. – TheRealMikeD Sep 11 '18 at 18:40
  • 1
    The first link (Remote Debugging with Safari Web Inspector) is dead, a backup is available at https://web.archive.org/web/20171207112510/https://developer.telerik.com/featured/a-concise-guide-to-remote-debugging-on-ios-android-and-windows-phone/ – Peter Sep 26 '19 at 10:17
  • 4
    RemoteDebug iOS WebKit Adapter is now dead too :/ In its wake there's the paid product: https://inspect.dev – Chris Hayes Apr 22 '21 at 14:59
  • 2
    inspect.dev will not inspect chrome on iOS https://inspectdev.notion.site/Inspect-docs-ce34803e95d04b48ac5fe1255c0c3f6f – cloudxix Oct 22 '21 at 01:20