How to Use weinre to remotely debug the phonegap Application

Source: Internet
Author: User

The display effects and browser rendering methods of applications developed using phonegap on the real machine and PC are still somewhat different. Debugging on the PC is very good, and various browsers come with debugging tools, which is very convenient to use, but once installed on the mobile phone, at this time, we need to use weinre, an excellent remote debugging tool. This article mainly describes how to use this tool for debugging step by step, in the past, the results were tested on the Chrome browser and directly installed on the mobile phone. If there is a problem, you can modify it and then install it again. This is very troublesome and inefficient.

Step 1: Install weinre. Here we use win7 as the testing environment.

Before this step, you need to install the nodejs server environment and its NPM module.

In the node window, enter the command line NPM-G install weinre for installation. After the installation is complete, start the next step.

Step 2: Enable weinre

Enter the command weinre -- boundhost-all--- httpport 8088 to listen to all IP addresses and use port 8088. The result is as follows:

Step 3: Enable the PC debugging page

Follow the prompts to enter http: // your IP address: 8088 In the Chrome browser (preferably this browser, because the WebKit kernel-based browser is required for debugging)

In this step, you must enter an externally accessible IP address.

A page is displayed as follows:

Step 4: Add the following script to your phonegap application as prompted

As a script for communication between your mobile app and the PC debugger.

Step 5: Click debug client user interface to enter the connection. At this time, the debugging interface is displayed. When the target is set to none, you can access your mobile phone application, at this time, the target file will become the target file you are currently accessing on your mobile phone.

Step 6: start debugging. This step is not much different from PC debugging. The only difference is that you click htmlelement on the PC and it will be highlighted on the mobile phone.

 

How to Use weinre to remotely debug the phonegap Application

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.