What is remote debugging?
To be blunt, it is possible to view and debug the content of a mobile page, such as HTML, CSS, JS, network resources, through the PC-side "F12 developer Tools".
(PS: End at the bottom of this page)
Official website
http://people.apache.org/~pmuellr/weinre/docs/latest/installing.html
Installation (requires Nodejs and NPM environments)
Weinre is also deployed on https://npmjs.org/package/weinre so this you can install it via:
sudo npm-g install weinre
Open cmd, configure the access method first, and turn on the service
Weinre--boundhost-all-
Open localhost:8080 The following interface shows that the installation was successful
The Weinre also provides the following startup parameters:
--help : Show Help for Weinre
--httpport [PortNumber] : Set the port number used by the weinre, default is 8080
--boundhost [hostname| IP address |-all-] : Default is ' localhost ', this parameter is to restrict the device that can access weinre server, set to-all-or specify IP, then any Devices can access weinre Server.
--verbose [true | false] : If you want to see more output about the weinre run condition, then you can set this option to True, and the default is false;
--debug [true | false] : This option is similar to--verbose and will output more information. The default is False.
--readtimeout [seconds] : server sends information to target/client time-out, default is 5s.
--deathtimeout [seconds] : The default is 3 times times the readtimeout, if the page does not have any response at this time, then the connection will be disconnected.
More parameters can be accessed http://people.apache.org/~pmuellr/weinre/docs/latest/Running.html
How do I do remote debugging? You must first allow the mobile phone to access the local PC-side website.
Please refer to this article: http://www.cnblogs.com/CyLee/p/6037732.html
and must succeed in order to get to the next step
In the Open Weinre service page, there is a script that introduces the code
Put it in the Debug page
Next, find another page in the Weinre service page
After entering this page, as shown, the default targets is none this means that there is no page access
At this time, the mobile phone login has been added to the <script> label page, targets has changed, it means success
You can see the familiar console interface immediately after opening the "Elements" section at the top.
When the mouse passes through the DOM element, the phone side will appear debugging effect.
JavaScript code can be debugged in the console
Above!!!
Remote Debugging Weinre