Johannes Fahrenkrug
Johannes Fahrenkrug

Reputation: 44818

How to use Safari Web Inspector for "Designed for iPad" apps running on Apple Silicon (M1) macOS?

I have an iPad app that uses a WKWebView. When I run it from Xcode in the iOS Simulator or on an iOS device, I can see the webviews show up in the Develop menu in Safari. However, when I run that same app with the "My Mac (Designed for iPad)" run destination, I see "No Inspectable Applications" under "Johannes' MacBook Pro" in the Safari Develop menu.

According to session 420 from WWDC 2016 (https://archive.org/details/wwdc2016videos/420_hd_optimizing_web_content_in_your_app.mp4), it's necessary to add "com.apple.webinspector.allow" to the entitlement when trying to inspect a webview in a macOS app. I did that, but when I try to run the app on my Mac from Xcode, the build fails saying "Provisioning profile "Springenwerk Development" doesn't include the com.apple.webinspector.allow entitlement." So it seems like the com.apple.webinspector.allow entitlement only works for "pure" macOS apps, not for iPad apps that can also run on M1 Macs.

So my question is: How can I use the Safari Web Inspector to inspect web views in a "Designed for iPad" app running on my M1 Mac when running it from Xcode?

Upvotes: 1

Views: 497

Answers (1)

msung
msung

Reputation: 3742

Without the mentioned entitlement and

  • Safari Version 17.6 (19618.3.11.11.5)
  • macOS 14.6.1 (23G93)
  • Xcode Version 15.4 (15F31d)

this works without a problem with our WKWebView app. I assume you did enable Safari Settings > Advanced > Show features for web developers?

Upvotes: 0

Related Questions