39

After upgrading to Xcode 11.3.1, I am having problems using Safari web inspector with the iOS 12.1 simulator. Every time that I run an app inside of an iOS 12.1 simulator device, it will show up in the Safari debug menu and allow me to connect to it, but the only tabs I will see are Sources, Console and Audit.

Here is a screenshot of the inspector attached to an instance of the Safari browser inside of the simulator.

enter image description here

Is there any way to resolve this?

Environment:

  • MacOS 10.14.6 (18G95)
  • Xcode 11.3.1
  • Safari 13.1 (14609.1.20.111.8)
  • Simulator Version 11.3.1 (SimulatorApp-912.5.1 SimulatorKit-570.3 CoreSimulator-681.17.2)
starmoon
  • 399
  • 3
  • 6
  • 1
    Welcome to Stack Overflow :) Do you have some reason to not upgrade the iPad to iPadOS 13.x? Can you try using a device running iOS/iPadOS 13.x and see if the issue persists? – Nimesh Neema Apr 01 '20 at 03:49
  • 3
    It work fine with devices running iOS 13.x – starmoon Apr 01 '20 at 16:20
  • 7
    What about those who wish to support iOs < 13 ? – FreePender Apr 03 '20 at 20:48
  • Same problem here. Is there at least any way to downgrade Xcode/Safari to resolve the issue? – Alexander Zinchuk Apr 26 '20 at 10:25
  • 1
    The issue exists for iOS version <= 12.0 But not for iOS version >= 12.4. Just test the Safari using simulators with these two versions. – Lee Elton May 08 '20 at 07:52
  • 2
    I am getting addicted to this poor user experience with so many breaks after every macOS upgrade. This is what Apple really means: get this simple update and I will break all previously working things for you. – Pmpr Jun 10 '20 at 07:17
  • I hit the same issue. I upgraded XCode and macOS ( to get Safari updates ). Neither helped. Once I updated to the latest Safari Technology Preview from https://developer.apple.com/safari/download/ it all worked and I could see `Network`, `Storage` tabs. – rustyMagnet Aug 11 '20 at 13:11
  • @rustyMagnet I just tried Safari Technology Preview 113, it didn't work for me. It can't even find an "Inspectible Application" for my iOS9 device. (I am on most recent High Sierra) – Lindsay-Needs-Sleep Sep 11 '20 at 23:52
  • @Lindsay-Needs-Sleep have you tried iOS 11 or above ? There are a lot of things with WKWebView are not supported in iOS 9. – rustyMagnet Sep 14 '20 at 09:37
  • 1
    @rustyMagnet Yep, I have. It works fine for my iOS 12.4.8 and iOS 13.7 devices. It doesn't work with iOS 9.3.5 or iOS 10.3.4. The problem is that a lot of our users can't afford new devices, so we want to continue supporting the older ones, but it has become incredibly difficult to debug and fix issues that only arise on 9+10 now. :( – Lindsay-Needs-Sleep Sep 15 '20 at 23:20
  • I have the same issue, iOs ipad 14.4.2 Mac os big sur 11.4 XCode 12.5 Safari 14.1.1 I tried to untrust my ipad, and renew. I tried with another devices. I tried with chrome dev tools but I'm not able to debug correctly because it can't upload .map. So it isn't usable. Nothing works. Maybe it's after an update because the last week, it worked. – Loic Martin May 17 '21 at 12:35

5 Answers5

12

Web Inspector engineer here...

This appears to be a bug in Web Inspector, and we are investigating the issue. Does it happen if you use a recent Safari Technology Preview to inspect your older iOS devices?

In addition to asking on SO.. it is strongly recommended to report bugs pertaining to developer tools at https://feedbackassistant.apple.com/ so that you get notifications about followup questions and when a fix has been shipped.

EDIT(May 14): The issue is fixed in our tree and the fix should be included in Safari Technology Preview 107 and the next major Safari release. Stay tuned for release notes.

Brian Burg
  • 679
  • 4
  • 10
  • Yes, also happens with Safari Technology Preview. Is there a way to report the bug that doesn't require signing up for an Apple Program? Honestly, I don't feel like installing an app just to report a bug.. – mantis May 08 '20 at 11:17
  • Is there an entry for this now by any chance? – Ian May 13 '20 at 15:43
  • I mean.. if you are developing on an Apple platform, you probably have an Apple ID already. What's the big deal about logging in? If you don't sign up, how are we going to contact you? Most bugs have at least one round of feedback / followup / questions. StackOverflow is a crappy bug reporting system. Please use the real bug reporting system, so that we can address these issues in a timely manner. – Brian Burg May 14 '20 at 17:46
  • just tried the technology preview 107 and it says enable web inspector on device, even though i have retried many times to re-enable it. – hiradyazdan Jun 01 '20 at 22:25
  • @hiradyazdan This sounds like a separate issue, please file a bug as outlined in my OP. – Brian Burg Jun 02 '20 at 23:23
  • 2
    iPadOS 13.5.1 & macOS 10.15.4 having the exact same problem – Pmpr Jun 10 '20 at 07:12
  • @Pmpr those releases are affected, the fix will be included in macOS 10.16 and iOS 14. – Brian Burg Jun 15 '20 at 23:30
  • @BrianBurg Could you include the link to this bug report? (I have downloaded safari technology preview 108, and now it just doesn't even show any debuggable contexts for iOS 9.3.5, 10.3.4. Works for 12.4.7, 13.5.1. I will file a separate report, but I would like to read the original.) – Lindsay-Needs-Sleep Jun 16 '20 at 05:46
  • @BrianBurg nvm, I see you can't share feedback reports. =/ – Lindsay-Needs-Sleep Jun 16 '20 at 06:06
  • 1
    So it looks like the problem is actually worse in Safari Technology Preview 107 and 108. For 107 and 108 Safari Technology Preview doesn't even appear to detect the webview for older iOS devices (< 12.x.x). – Lindsay-Needs-Sleep Jun 16 '20 at 06:35
  • 2
    @Lindsay-Needs-Sleep Safary Technology Preview 108 worked for me using iOS Simulator 11.0.1. – Elise Jun 17 '20 at 08:34
  • "wait until iOS14 / MacOS 10.16" is not an acceptable answer. How the heck are we supposed to fix issues until that point? – Zayin Krige Jun 24 '20 at 12:17
  • 1
    @Elise Thanks! I only had devices with iOS 10 and 9, (so I guess it is broken only for less than 11). – Lindsay-Needs-Sleep Jun 28 '20 at 06:27
  • Yes it looks like the Web Inspector is completely broken for iOS 10! – now Aug 25 '20 at 12:48
  • I guess apple has given up on us? Maybe if enough of report issues to https://feedbackassistant.apple.com/ they will do something about it? T.T Currently, it says this on my issue: "Recent Similar Reports:Less than 10". **Please report the issue!** Feel free to use a title like: "Can't debug webview for iOS < 11" – Lindsay-Needs-Sleep Sep 11 '20 at 23:55
  • Hi folks, sorry for the lack of clarity. I realize some folks still use iOS 9 and earlier. The WebKit project has no way to run automation against simulators and devices running those older releases, given the current testing infrastructure. For remote inspection, iOS 10.3.4 is the minimum version supported by Safari 14. In general, Web Inspector's backwards compatibility matches the oldest Simulator runtime that Xcode supports in its most recent release. If you are unable to inspect a device or simulator running iOS 10.3.4, please file a report at feedbackassistant.apple.com. – Brian Burg Sep 12 '20 at 21:00
  • Thanks for the response! I just tried Safari Technology Preview 113 (14.0.1), and it still doesn't work with my iOS 10.3.4 device. I submitted new feedback to the feedback assistant. – Lindsay-Needs-Sleep Sep 13 '20 at 23:41
  • The latest iOS 10 simulator I can find in the simulator download list is 10.3.1. Does this mean it's impossible to debug iOS 10 without a real device that hasn't been upgraded? – wilsonpage Sep 17 '20 at 10:41
  • Using the the latest Safari Tech Preview (113) and iOS 10.3.1 Simulator the tab eventually showed up in the Develop menu and Inspector is working as normal. Unsure what triggered it. – wilsonpage Sep 17 '20 at 10:53
  • 4
    This issue is back now since I upgraded to Big Sure 11.4. Even the tabs that are visible are unusable. I hope Apple fixes that soon, as it makes remote debugging of iPhone web views impossible. – waldgeist May 26 '21 at 14:41
  • 5
    Big Sur 11.4 broke it again! – an0 May 26 '21 at 21:48
  • 2
    STP Release 125 (Safari 14.2, WebKit 16612.1.15.1.12) works for me on Big Sur 11.4 – helman May 27 '21 at 08:41
  • 1
    Can confirm that STP release 125 on Big Sur 11.4 does indeed work as per @helman – scaba May 27 '21 at 15:19
5

I don't yet want to update my macOS from High Sierra, but I still run into this bug (even on a clean installed test system).

Elsewhere it was suggested to use Safari Technology Preview - but now it's only for Catalina an Big Slur.

Fortunately you can still download older versions using Archive.org (bless their hearts).
This is the latest I found for High Sierra (Release 80, Posted: April 12, 2019):

https://web.archive.org/web/20190420021102/https://developer.apple.com/safari/download/

I guess you can find a later one for Mojave too.

biziclop
  • 13,654
  • 3
  • 45
  • 62
  • I wish I could upvote more. :( You are a real life saver. – Sanoop Surendran Jun 30 '20 at 10:51
  • @Sanoop: I know, I saved my own one too with this trick. :) Anyway, it's nice from Apple for breaking High Sierra's Safari at the very last minute… – biziclop Jun 30 '20 at 14:08
  • On Catalina, I tried technology preview 108, 107, 104,103,102,101, 98, 96. None worked. :( Guess I need to figure out how to go back to high sierra.... – Lindsay-Needs-Sleep Sep 11 '20 at 23:40
  • @Lindsay-Needs-Sleep: That sucks. Going forward doesn't help? https://www.macrumors.com/2020/09/09/apple-releases-safari-technology-preview-113/ – biziclop Sep 12 '20 at 07:38
  • I just tried Technology Preview 113, for my iPhone5 (10.3.4) and iPad3 (9.3.5), it shows "No Inspectible Applications" under the "Develop" menu. (Regular Safari 13.1.2 at least finds the inspecitble application, but matches the behavior posted in the original issue.) Both the technology preview and regular safari work with my iOS 13 device. – Lindsay-Needs-Sleep Sep 13 '20 at 23:29
  • @Lindsay-Needs-Sleep: I use the iOS Simulator on High Sierra, and Safari TP 80 can connect to the iOS 12 but not to the iOS8 device (though the Web Inspector setting is enabled on iOS8Safari and iOS12Safari has no such setting). -- Edit: actually it can, maybe I messed with a simulator device. – biziclop Sep 14 '20 at 08:15
1

(This is answer is less of a fix, and more of a superior alternative I wish I had discovered much sooner.)

You can just debug iOS WebView with Chrome Dev Tools instead of Safari!!

Windows
You can follow this guide to debug iOS webview on Windows with Chrome DevTools. (Tested and works with iOS 9 and iOS 14 so far!!) Edit: not working with iOS 9 today.... not sure what changed...

Linux / Mac
I believe you can basically follow the windows guide above for linux and Mac as well. (Comments confirming/denying welcome!)

Troubleshooting any part of the guide
For any part of the guide that doesn't work (because out of date or linux/Mac), you can follow the instructions that are included directly with the tools that make this possible:

Lindsay-Needs-Sleep
  • 916
  • 1
  • 11
  • 22
0

I was having the same issue with my iPad (iOS version: 11.x).

I resolved the issue by using another iPad (version: 13.3.1).

I think it doesn't support older version of web browser (Safari).

-4

You can actually right-click on the tabs to enable/disable certain tabs. After updating some of my tabs were also gone, this is how you restore them.

enter image description here

Gertjan Smits
  • 360
  • 2
  • 11
  • Not sure why my answer is marked as not useful... be a man, let me know why. Did I misunderstood the question? – Gertjan Smits Apr 08 '20 at 10:11
  • 1
    Yes, the problem @starmoon is having is that Safari 13.1 is failing to inspect iOS devices & simulators earlier than iOS 13. If you start the inspector with one of those devices/simulators, you can see `Audit Warning: "data-custom" is too new to run on this inspected page` in the Audit tab. – ion Apr 09 '20 at 21:52
  • 1
    Well okay, I didn't got that from his question (still don't actually). My bad. – Gertjan Smits Apr 17 '20 at 13:45
  • Although this answer didn't solve the Safari Technology Preview bug it did show me neat shortcut. Upvote from me. – rustyMagnet Aug 11 '20 at 13:14