Search code examples
node.jsandroid-webviewadbchrome-remote-debugging

chrome-remote-interface socket hang up


I try to remote debug a WebView on android.

I already goth the process ID with this command adb shell grep -a webview_devtools_remote /proc/net/unixc
Then i made a port forwarding with this command forward tcp:9483 localabstract:webview_devtools_remote_<The ID>
When i access http://localhost:9483 in my browser i get a link to chrome://inspect -> it is working

But when i try to connect with the chrome-remote-interface package i get a stocket hang up error

This is the code i tyred

const CDP = require('chrome-remote-interface');

async function run() {
let client;
    try {
        client = await CDP({port:9483});
        const {Network, Page} = client;

        console.log("working")
    } catch (err) {
        console.error(err);
    } finally {
        if (client) {
            await client.close();
        }
    }
}

await run()


Solution

  • setting this option solves the problem local: true