Essential Tools adb tools,android Chrome
Turn on the phone debug mode first
ADB forward tcp:9919 localabstract:chromedevtoolsRemote
成功会提示* daemon not running. starting it now on port 5037 ** daemon started successfully *不成功的话用这个命令再试adb kill-server
Then open the link below, where the 9919 is specified in the ADB command above
http://localhost:9919/
You will see a link like this:
Http://chrome-devtools-frontend.appspot.com/serve_rev/@176236/devtools.html?ws=localhost:9919/devtools/page/1
Due to the well-known reason Appspot is in the heterogeneous space, we need to use the cost of the debugger
To replace the cost of devtools.html with a chrome-devtools://devtools/bundled/devtools.html .
chrome-devtools://devtools/bundled/devtools.html这个地址可能会不一样可以用弹出窗口的方式打开调试器在弹出来的调试器中按ctrl+shift+i来调试调试器,在新的调试器获得这个地址(很拗口,但就是这样)
Once you have the correct local debugger address, you can replace it with a script
"' JavaScript
var tabs = Document.queryselectorall (' A '), Localdevadd = ' chrome-devtools://devtools/bundled/devtools.html ';
for (var i = 0; i < tabs.length; i++) {if (Tabs[i].href && tabs[i].href.indexof ('/devtools.html ') >-1) {T Abs[i].href = Tabs[i].href.replace (/.*devtools.html/, Localdevadd); }}
```
Click on the corresponding tab to see the debugger.
Graphic version Http://www.tuicool.com/articles/ZJfeAzi