For the existence of embedded in the client WebView project, in the development process we want to be like a PC directly to debug, improve our usual development efficiency, this time we can use the WebApp Remote Debugging tool-weinre.
Installation:
This tool requires node. JS support and must be installed before installing node. js. Download node.js,:http://nodejs.org/download/(can be the latest version);
After node installation is complete, install weinre using node's NPM module management tool,
CMD under input npm-g install Weinre
You can use it when you're done.
Use:
1. Under CMD, enter:
Weinre-httpport 8081-boundhost-all-//8081 Custom ports, you can choose the port number according to your needs to start the debugging service (note: The service needs to be turned on before each commissioning, keep it open during commissioning)
2. Add Debug Code:
<script src="http://ip:8081/target/target-script-min.js#anonymous"></script> //开启服务的pc及端口号
3. Debug: Enter the PC address of the service in the browser,
http://localhost:8081//or http://ip:8081/
Visible clients accessing the page (red callout)
Green for the activated page, you can elements, the console to do the appropriate action
Tips:
1. When debugging the remote interface data, the data can be printed on the Winnre console platform via Console.log (), so that the data returned in the background is clearly visible and the interface related issues are viewed.
2. For debugging on-line test environment, the reference can be called local code for debugging;
3. Before you go online, remember to check if there are any local error issues.
WebApp Remote Debugging Tools