Reputation: 65
Ref 1. In WWDC2016, Apple announced about web inspector entitlement.
"To protect the integrity of your app, we don't let just anyone download your app and use Web Inspector to poke around your app.
So you'll need to add this entitlement to your app's Entitlements File for local development.
... you add this while you're developing and then you take it back out when you ship your app. Then once you have this entitlement, your device and app will show up in the Develop menu and you can attach to it. And it's easy — just that easy to connect Web Inspector to your JSContext and WebViews."
Ref 2. The Guide of Webkit.org.
Once Web Inspector is enabled, connecting the iOS device to any macOS machine, either via a physical cable or after configuring wireless debugging in Xcode, the name of the iOS device will appear as a submenu in the Develop menu of Safari (and Safari Technology Preview) on the connected macOS machine, allowing for remote inspection of:
Following these references, I created an entitlement file with 'com.apple.webinspector.allow = 1' and added it on my project.
Wrote the path of entitlements down on Code signing Entitlements - Debug.
After that, a build error has found "Provisioning profile doesn't include webinspector allow entitlement." and it's gone when I put "Any SDK" underneath of Debug path.
Changed build configuration to "Debug" and Archive.
Finally downloaded and install my app via FTP server but still can't debug WKWebView on mac safari. I still see grayed "No inspectable Applications." sentence.
I tried Xcode 12.4, the latest version of safari, safari technology preview also.
Did I miss something or it's not possible to inspect downloaded iOS application?
Upvotes: 5
Views: 3860
Reputation: 452
You can debug web content in Safari Web Inspector only if the iOS app is running from Xcode.
You don't have to add any entitlement - the one you mentioned applies to macOS apps only.
From https://developer.apple.com/videos/play/wwdc2016/420/?time=351:
Now for iOS, apps will only show up when you build and run them from Xcode.
But when we're talking about a Mac app, there's just one more thing you got to do. To protect the integrity of your app, we don't let just anyone download your app and use Web Inspector to poke around your app. So you'll need to add this entitlement to your app's Entitlements File for local development.
Upvotes: 1