10

Android can use desktop Chrome's web inspector to debug HTML/CSS issues embedded in an App's WebView, as long as you connect them through USB.

I've been searching all over google and this site and cannot find any information regarding this. Is there a similar way to inspect HTML/CSS elements/rules in iOS?

Because there are some issues that only affects webview, so viewing it from iOS Safari cannot reproduce some issues.

1 Answer 1

12

You can do this using Safari on Mac. First, go to settings on iPhone → Safari → Advanced. Then enable the "Web Inspector" option and follow the instructions to enable on Mac.

Edit: this will only work with apps installed using Xcode.

Screenshot of iOS Safari settings advanced page with Web Inspector  option enabled. Explanation below that option reads "To use the Web Inspector, connect to Safari on your computer using a cable and access your iPhone from the Develop menu. You can enable the Develop menu in Safari’s Advanced Preferences on your computer."

10
  • 1
    But this only applies to website opened in iOS safari, right? I'm talking about websites that are inside another App, embedded in webview.
    – Artvader
    Apr 19, 2018 at 4:12
  • 2
    No, I'm talking about webview inside an iPhone app. Just try it. Run your app in the device. See to it that webvirw is visible. Now open safari on mac and do as described in the screenshot. Apr 19, 2018 at 4:38
  • Does the app developer have to write something in the App first to enable this or is this on by default on all Apps?
    – Artvader
    Apr 19, 2018 at 5:00
  • It's enabled by default. Apr 19, 2018 at 5:02
  • 14
    @SonuVR This doesn't work for the webview in the LinkedIn app, unfortunately... Any idea? EDIT: I found out this only works for apps installed using Xcode. "You can only debug webviews in applications loaded onto your device through Xcode. You can't debug webviews in apps installed through the App Store or Apple Configurator."
    – Savado
    Jul 28, 2020 at 10:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.