是否可以检查在 Safari 上发布的 iOS 应用程序的调试模式?
Is it possible to inspect debug mode released iOS app on safari?
Ref 1. 在 WWDC2016 中,Apple 宣布了 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."
参考 2. 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:
- Safari 中的任何页面
- 添加到主屏幕的网站
- 开发人员配置的应用中的网络内容
- SFSafariViewController
- WKWebView
- UIWebView
- JS上下文
根据这些参考资料,我使用 'com.apple.webinspector.allow = 1' 创建了一个授权文件并将其添加到我的项目中。
在代码签名权利 - 调试上写下权利的路径。
在那之后,发现构建错误 “供应配置文件不包括 webinspector 允许授权。” 当我将“任何 SDK”放在调试路径下时它就消失了。
将构建配置更改为“调试”和存档。
终于通过 FTP 服务器下载并安装了我的应用程序,但仍然无法在 mac safari 上调试 WKWebView。我仍然看到灰色的“没有可检查的应用程序”。句子.
我试过Xcode12.4,safari最新版本,safari技术预览也有。
我是不是遗漏了什么或者无法检查下载的 iOS 应用程序?
仅当 iOS 应用来自 Xcode 的 运行 时,您才能在 Safari Web Inspector 中调试 Web 内容。
您不必添加任何权利 - 您提到的权利仅适用于 macOS 应用程序。
来自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.
Ref 1. 在 WWDC2016 中,Apple 宣布了 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."
参考 2. 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:
- Safari 中的任何页面
- 添加到主屏幕的网站
- 开发人员配置的应用中的网络内容
- SFSafariViewController
- WKWebView
- UIWebView
- JS上下文
根据这些参考资料,我使用 'com.apple.webinspector.allow = 1' 创建了一个授权文件并将其添加到我的项目中。
在代码签名权利 - 调试上写下权利的路径。
在那之后,发现构建错误 “供应配置文件不包括 webinspector 允许授权。” 当我将“任何 SDK”放在调试路径下时它就消失了。
将构建配置更改为“调试”和存档。
终于通过 FTP 服务器下载并安装了我的应用程序,但仍然无法在 mac safari 上调试 WKWebView。我仍然看到灰色的“没有可检查的应用程序”。句子.
我试过Xcode12.4,safari最新版本,safari技术预览也有。
我是不是遗漏了什么或者无法检查下载的 iOS 应用程序?
仅当 iOS 应用来自 Xcode 的 运行 时,您才能在 Safari Web Inspector 中调试 Web 内容。
您不必添加任何权利 - 您提到的权利仅适用于 macOS 应用程序。
来自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.