Weinre is a mobile page remote debugging tool, you can use the computer's Chrome or Firefox to debug your phone access to the page, in the computer debugger any action can be reflected on the phone, and in the computer access page for debugging. Weinre has now been ported to the node platform, where installation is easy, and there is no need to install other complex environments.
Introduction to the architecture of Weinre
The weinre implementation of remote debugging is achieved through the following three sections:
Target – the page being debugged.
Client -page debugger, DOM structure modification, style modification, JS operation for the target
Proxy – is an HTTP server that guarantees this target and client communication
Describes the communication between the three.
Deployment run of Weinre
This is only used for installation under the node platform:
A: Use NPM to install weinre (this is a global installation, I have installed it so it doesn't show the same as you)
Npm–g Install Weinre
B : run weinre service weinre--httpport 8081--boundhost 172.30.108.139 default port is 8081 can not be set, Boundhost is the IP address of the debug server binding can also bind domain name, here set its own IP address can
Use of Weinre
A : Set the target (the page being debugged) and add the following code to the target page:
Http://172.30.108.139:8081/target/target-script-min.js#debugpagetag IP address #后面为要调试页面的标识 for your debug server address, different pages can be set to different identities
B: The debugger accesses the following link http://172.30.108.139:8081/you can see the address of debugclient:
http://172.30.108.139:8081/client/#anonymous
Change # After the flag for the target page JS after the setting of the flag, you can debug the page remotely. such as: http://172.30.108.139:8081/client/#debugpagetag, you can see the connection target through this address, the green part is the target of the connected device, you can choose the corresponding target for debugging
C: using the debugger to target operations
Debugger: Alert (111)
Target Machine effect:
Remote debugging of a mobile page using weinre