Member-only story

WKWebView code causes crash when using the Xcode debugger with iOS 14.5

David Fekke

--

Developers trying to debug with Xcode and Safari may run into this crash

Photo Illustration by David Fekke

Originally published at https://fek.io.

I was running into nasty crash whenever I tried to debug the WKWebView in one of my iOS apps. It is a common practice among developers to debug using Safari while running JavaScript code in their WebViews.

I noticed several months ago whenever I had Safari running on my Mac, and I was running the debugger in Xcode, I would get a crash with the following exception.

It turns out there is a bug in iOS 14.5 and 14.6 that prevents developers from running a debug session in Xcode while Safari is running. You can read about it here in Apple’s forum;

https://developer.apple.com/forums/thread/679015

Workaround

In the Apple forum there were some suggestions on installing the Safari Technology Preview. I installed that version of Safari, and it did not resolve the issue for me, but it might for others.

What did wind up working for me was downloading an older version of the iOS simulator. Version 14.3 of the simulator seems to have done the trick for me with my debugging sessions.

--

--

David Fekke
David Fekke

Written by David Fekke

I am a software engineer and commercial pilot in jacksonville, Fl. I also produce videos for the Polyglot Engineer Channel on YouTube.

No responses yet

Write a response