google / ios-webkit-debug-proxy

A DevTools proxy (Chrome Remote Debugging Protocol) for iOS devices (Safari Remote Web Inspector).

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot debug Cordova apps on iOS 14+

RedMickey opened this issue · comments

Hello, we are Cordova Tools team. We are using IWDP for debugging Cordova and Ionic applications from VS Code editor.

We faced some problems when we were trying to debug a plain Cordova app on iOS 14 using IWDP and its UI. We tried to set a breakpoint in app sources, but we couldn't since the list of sources was empty. Also in the Console tab we couldn't see any logs from the application.
We found out that the application responds to any CDP requests with errors, e.g.:

Reply From Debugger To Target {
  "id": 1002,
  "method": "Debugger.enable",
  "params": {}
}

Reply From Target To Debugger {
  "error": {
    "code": -32601,
    "message": "'Debugger' domain was not found",
    "data": [
      {
        "code": -32601,
        "message": "'Debugger' domain was not found"
      }
    ]
  },
  "id": 1002
}

It seems that Chrome debugger couldn't attach to the app over IWDP.
I attach IWDP logs for a Cordova app debugging case.

We also tried to debug an Ionic Cordova app and faced the problem that the application doesn't send any logs to debug console. The application also doesn't send debugger pause events when we are trying to reach a breakpoint.
This behavior is pretty similar to this issue.

It seems that IWDP hasn't completely supported debugging on iOS 14 yet.

System info:
IWDP version: ios_webkit_debug_proxy 1.8.8, built with libimobiledevice v1.3.0, libplist v2.2.0
iOS device: iPhone Xr iOS v14.0
macOS: v10.15.7
web-inspecron: on

hi @RedMickey safari and chrome dev tools protocols diverged a lot, please check out the readme https://github.com/google/ios-webkit-debug-proxy#using-with-devtools

Looking at microsoft/vscode-cordova#670 I can see the line

Ios-webkit-debug-proxy (IWDP) allows to transform Webkit Protocol to Chrome DevTools Protocol.

this is not entirely true, iwdp sole responsibility is to forward safari webinspector traffic. It's not responsible for converting dev tools protocols

@RedMickey I could help pinning down exact changes in dev tools protocol if you need assistance on this

Hi @artygus, thank you for your help. We found out how to correctly process messages from the application on our side. I'm closing the issue.