Remote debugging Chrome for iOS

22,045

Solution 1

You cannot directly remote debug Chrome on iOS currently. It uses a uiWebView that may act subtly different than Mobile Safari

You have a few options.

Option 1: Remote-debug Mobile Safari using Safari's inspector. If your issue reproduces in Mobile Safari, this is definitely the best way to go. In fact, going through the iOS simulator is even easier.

Option 2: Use Weinre for a slimmed down debugging experience. Weinre doesn't have much features but sometimes it's good enough.

Option 3: Remote debug a proper uiWebView that functions the same.

Here's the best way to do this. You'll need to install XCode.

  1. Go to github.com/paulirish/iOS-WebView-App and "Download Zip" or clone.
  2. Open XCode, open existing project, and choose the project you just downloaded.
  3. Open WebViewAppDelegate.m and change the urlString to be the URL you want to test.
  4. Run the app in the iOS Simulator.
  5. Open Safari, Open the Develop Menu, Choose iOS Simulator and select your webview.
  6. Safari Inspector will now be inspecting your uiWebView.

enter image description here

enter image description here

enter image description here

Solution 2

Is it true that I need Safari on MacOS X to remote debug Chrome for iOS?

As far as I understand, yes.

Does Desktop Chrome allow anything?

No

Is Chrome for iOS just a webview application?

Yes, the app would be rejected otherwise, this is why Mozilla originally did not build a browser for iOS.

Solution 3

The Firefox Tools Adaptor allows one to use Firefox DevTools to debug websites on Safari or Google Chrome for iOS or Android.

https://github.com/mozilla/valence#debugging-safari-firefox-and-other-webviews-on-ios

Solution 4

If you're just looking for the console logs, there's chrome://inspect, which will display console.log of other tabs in iOS Chrome.

enter image description here

Solution 5

I've had some success with the iOS remote debug webkit adapter.

Install ios-webkit-debug-proxy and libimobiledevice

npm install remotedebug-ios-webkit-adapter -g

Enable remote debugging in Safari - iOS Settings => Safari preferences => enable "Web Inspector"

Make your computer trust your iOS device- starting iTunes could prompt the "Trust this computer" dialog.

remotedebug_ios_webkit_adapter --port=9000

Open tabs should show up in chrome://inspect/#devices Chrome debuig device inspection

Share:
22,045
Dan
Author by

Dan

Updated on April 23, 2021

Comments

  • Dan
    Dan about 3 years

    I'm trying to debug an error on Chrome for iPad. How can I do that?

    Additional info:

    I know how to debug Safari for iOS. I just don't have a Mac at the moment.

    • Is it true that I need Safari on MacOS X to remote debug Chrome for iOS?

    • Does Desktop Chrome allow anything?

    • Is Chrome for iOS just a webview application?