簡體   English   中英

鍍鉻遠程接口插座掛斷

[英]chrome-remote-interface socket hang up

我嘗試在 android 上遠程調試 WebView。

我已經用這個命令獲得了進程 ID adb shell grep -a webview_devtools_remote /proc/net/unixc
然后我用這個命令進行了端口轉發forward tcp:9483 localabstract:webview_devtools_remote_<The ID>
當我在瀏覽器中訪問http://localhost:9483 ,我得到了一個指向chrome://inspect的鏈接 -> 它正在工作

但是當我嘗試連接chrome-remote-interface包時,我收到了一個stocket hang up錯誤

這是我累了的代碼

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()

設置此選項可解決local: true問題local: true

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM