Is there any way to debug chrome in any IOS device
Asked Answered
D

3

139

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.

Draught answered 4/7, 2016 at 7:48 Comment(2)
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 helpAstred
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://".Cruciferous
S
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.

Savannahsavant answered 4/7, 2016 at 9:10 Comment(8)
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 debuggingTrismus
@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.Savannahsavant
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.Fowl
@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?Duteous
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.Intro
The first link (Remote Debugging with Safari Web Inspector) is dead, a backup is available at web.archive.org/web/20171207112510/https://…Caldron
RemoteDebug iOS WebKit Adapter is now dead too :/ In its wake there's the paid product: inspect.devLucaslucca
inspect.dev will not inspect chrome on iOS inspectdev.notion.site/…Bula
S
179

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

Sled answered 30/3, 2019 at 16:47 Comment(9)
AMAZING. can't believe I was not aware of this.Duplet
When did this get added? This does not work on my old ipad - running Chrome for iOS 71.0.3578.89.Newmark
Just found the answer to my question - it's a new feature in version 73, which requires iOS 11 at minimum.Newmark
Does this still work? I don't see any errors from other tabs on iOS 14.4 with Chrome 87.0.4280.77Eon
I have the same issue. I cannot see any logs there. Anyone got a sollution?Manner
Same issue on iOS 14.4.2 Chrome 87.0.4280.163 - anywhere we can report this?Ultann
This is working just fine for me. Latest iOS (14.6) and Chrome (91.0.4472.80) as of this writing.Gorey
I wonder why it doesn't work on android :`(Holocene
Unfortunately the logs don't show everything, it doesn't work properly.Axes
S
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.

Savannahsavant answered 4/7, 2016 at 9:10 Comment(8)
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 debuggingTrismus
@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.Savannahsavant
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.Fowl
@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?Duteous
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.Intro
The first link (Remote Debugging with Safari Web Inspector) is dead, a backup is available at web.archive.org/web/20171207112510/https://…Caldron
RemoteDebug iOS WebKit Adapter is now dead too :/ In its wake there's the paid product: inspect.devLucaslucca
inspect.dev will not inspect chrome on iOS inspectdev.notion.site/…Bula
N
6

This answer is to help people who stumble upon this question.

Staring from Chrome 115, we can debug the webpage loaded in iOS chrome using safari developer tools in Mac.

  1. Connect mac and iOS device with cable
  2. In Mac, open Safari -> Preferences -> Advanced and check the Show Develop menu in menu bar checkbox
  3. In iOS device, open Chrome -> Settings -> Content Settings and enable Web Inspector option.
  4. Navigate to the page you want to debug in iOS chrome browser
  5. In Mac, open Safari -> Develop menu -> cursor over the iOS device name and it will show the open tabs to debug

Note: Make sure your iOS device stays unlocked


Requirements:

On your iOS device you need:

iOS 16.4 or greater.

Chrome 115 or greater.

source: https://developer.chrome.com/blog/debugging-chrome-on-ios/

Connecting mac and iOS device:

https://webkit.org/web-inspector/enabling-web-inspector/

Nuptial answered 28/11, 2023 at 9:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.