Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After latest update of Xcode (10.2), Web Inspector is not working

I've posted this as a bug on Apple's Bug Report site. I thought I'd post here too and see what I can find out as to how I might fix this...

Area:

Debugging WKWebView with Xcode using Web Inspector in Safari. I'm running on MacOS Mojave Version: 10.14.3 (18D42).

Summary:

After letting upgrade of Xcode run (Version 10.2 (10E125)), when I pick the proper Device option from Safari's [Develop] menu (Version 12.0.3 (14606.4.5) of Safari), the Web Inspector comes up while running the app like before, but it displays as basically blank and useless.

Steps to Reproduce:

1- start iOS app in the Simulator that has a WKWebView that is successfully displaying a web page that has runnable JavaScript in it. Here I've picked the iPhone 6 Simulator (Figure 1) Here I've picked the iPhone 6 Simulator in Xcode

. running app (Figure 2) App running in simulator... WKWebView takes whole screen

. enter image description here (Figure 3) screen after clicking [Run Db Startup Code] button (notice new info under "Test Info:")

. enter image description here (Figure 4) JS code that runs when this button is clicked.

. 2-Go to Safari window and pick [Develop] menu.

3- Pick Simulator option for the device like: Simulator -- iPhone 6 -- iOS 12.2 (16E226)

4- Pick the "index.html" option enter image description here (Figure 5) Picking option in Safari after app in iPhone Simulator has been started

.

5- Web Inspector comes up, but none of the page's resources are listed (including index.html) enter image description here (Figure 6) Web Inspector brought up ... this is the Debugger tab. Nothing appears.

.

enter image description here (Figure 7) Web Inspector, Resources tab... also blank. Clicking the Refresh button above the Network tab does nothing.

.

6 - Clicking the Web Inspector's refresh button does nothing

Expected Results:

Resources to load, to be able to set break-points on JavaScript lines of code. to have JS code stopped on any debugger; statement to be able to step through JS code and examine current JS variable values.

Actual Results:

As said before, the web inspector window comes up basically empty (like there is no page loaded into the WKWebView at all (even though there is and I can visually see that JS code runs when I click buttons on test interface).

Note: If I try running on actual tethered device, NO option shows up in Safari's [Developer] menu!

like image 913
Orville Chomer Avatar asked Mar 27 '19 03:03

Orville Chomer


People also ask

How do I enable Web Inspector?

Enable the Develop Menu Choose Safari > Preferences, and click Advanced. At the bottom of the pane, select the “Show Develop menu in menu bar” checkbox. Choose Develop > Show Web Inspector.

Which is the latest Xcode version?

Xcode is Apple's integrated development environment (IDE) for macOS, used to develop software for macOS, iOS, iPadOS, watchOS, and tvOS. It was initially released in late 2003; the latest stable release is version 13.4. 1, released on June 2, 2022, via the Mac App Store with macOS Monterey.

How do I inspect Xcode simulator in Safari?

You'll need to go to Settings > Advanced and check the Show Debug Menu option. Then you'll see the option to open the web inspector for the Simulator right from that menu. With the Web Inspector open, you can debug inside the Simulator just like you could right in a desktop browser with DevTools.


2 Answers

Managed to resolve it updating the OS to 10.14.4 and correspondingly the Safari to 12.1.

like image 136
raman Avatar answered Dec 15 '22 15:12

raman


Nothing worked for me... but then I found Safari Technology Preview https://developer.apple.com/safari/technology-preview/ - installing this latest version of safari did the trick for me.

like image 23
rob_james Avatar answered Dec 15 '22 15:12

rob_james