Remote debugging of a mobile page using weinre

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.