官方文档
使用Devtools工具调试前端页面
- 打开web debug模式
webview.WebviewController.setWebDebuggingAccess(true)
-
chrome 访问
chrome://inspect/#devices
Discover network targets 中添加 localhost:9222

-
创建cat.sh
com.coooliang.yourappbundname 为你应用的bundlename,在app.json5中
name=$(hdc shell ps -ef | grep com.coooliang.yourappbundname | awk '{print $2}')
echo "prefix_${name}"
pid=${name##*_}
hdc fport tcp:9222 localabstract:webview_devtools_remote_$pid
- 运行
./cat.sh

- 其它
使用hdc fport ls查看所有进程

进程太多要清掉,关闭服务
hdc server kill
hdc server start
使用hdc list targets查看设备




















