Ionic应用 – Cordova – Safari调试不起作用

huangapple go评论66阅读模式
英文:

Ionic app - Cordova - Safari Debug not working

问题

过去,我可以将我的Ionic Cordova应用程序运行到我的iPhone上,然后将其连接到我的Mac,然后在Mac上打开Safari,转到开发 -> PHONE_NAME -> localhost 来检查我的应用程序。

但是,当前当我进入开发菜单时,PHONE_NAME会显示,但是应用程序不会显示为选项。

如果我在手机上打开Safari,它会显示为一个选项,所以我知道它可以工作,只是对于我的Ionic应用程序不起作用。

我看到cordova-ios 6.3.0提到他们修复了这个问题:

> 这个版本包含一个修复,允许检查最新的iOS和Xcode版本中的WebView内容。它还修复了一个iOS 16的错误和与NodeJS 18相关的问题。
> 引用

https://cordova.apache.org/announcements/2023/04/15/cordova-ios-release-6.3.0.html

但是,在更新到cordova-ios 6.3.0之后,问题仍然存在。

有什么其他尝试的想法吗?

Mac OS版本:Ventura 13.4

iPhone iOS版本:16.5

xCode版本:14.3.1

英文:

In the past I was able to run my Ionic Cordova app onto my iPhone and plug it into my Mac, then open Safari on my Mac and go to Develop -> PHONE_NAME -> localhost to inspect my app.

Currently when I go to the Develop menu, PHONE_NAME shows up however, the app does not show up as an option.

If I open Safari on my phone it shows up as an option so I know it works, just not with my Ionic app.

I saw that cordova-ios 6.3.0 mentions they fixed a bug with this:

> This release contains a fix to allow inspecting of WebView content with the
> latest iOS and Xcode versions. It also fixes an iOS 16 bug and issues
> with NodeJS 18.
> Blockquote

https://cordova.apache.org/announcements/2023/04/15/cordova-ios-release-6.3.0.html

But after updating to cordova-ios 6.3.0 the problem persists.

Any ideas what else to try?

Mac OS Version: Ventura 13.4

iPhone iOS Version: 16.5

xCode Version: 14.3.1

答案1

得分: 2

经过进一步调查,似乎在 cordova-ios 上已经修复了这个问题,但 Ionic 使用了自己的 WebKit。

因此,修复应该应用于 Ionic 的插件:
https://github.com/ionic-team/cordova-plugin-ionic-webview

我发现该插件上已经有一个包含修复的拉取请求:
https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/677

我通过分叉主分支、应用更改,然后更新我的 package.json 来在本地使检查工作正常,如下所示:

"cordova-plugin-ionic-webview": "github:<你的Github用户名>/cordova-plugin-ionic-webview"
英文:

After looking into this more, it seems the problem has been fixed on cordova-ios, however ionic uses it's own webkit.

So the fix would have to be applied to Ionic's plugin:
https://github.com/ionic-team/cordova-plugin-ionic-webview

I found there is already a pull request on that plugin with the fix:
https://github.com/ionic-team/cordova-plugin-ionic-webview/pull/677

I was able to get the inspect working for me locally by forking the master branch, applying the changes then updating my package.json like so:

&quot;cordova-plugin-ionic-webview&quot;: &quot;github:&lt; YourGithubUsername &gt;/cordova-plugin-ionic-webview&quot;

huangapple
  • 本文由 发表于 2023年6月9日 01:39:33
  • 转载请务必保留本文链接:https://go.coder-hub.com/76434408.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定