Android Development Series 10 Cordova architecture learning Weinre remote debugging technology

Source: Internet
Author: User

Android Development Series 10 Cordova architecture learning Weinre remote debugging technology

Pages on mobile phones are not as convenient for debugging as desktop development. You can use Weinre for remote debugging to facilitate development. This article describes how to install and use windows.

Install

Run:

Npm install-g weinre

The installation path may be as follows:

Enter the command

Weinre-boundHost-all-
To start.


Other parameters:

boundHost:    -all-httpPort:     8081reuseAddr:    truereadTimeout:  1deathTimeout: 5

You can also modify the default configuration in the configuration file.

Open the URL in a browser:
Http: // localhost: 8080

Chrome is recommended.

If a firewall exists, you must allow data access through port 8080.

Now you can connect to the Cordova program for debugging. Put the following code in index.html.

<Script src = "http: // ip address of your pc: 8080/target/target-script-min.js"> </script>

If you use a simulator, you can set the IP address to localhost. Except android simulators, the ip address must be set to 10.0.2.2.
To use a physical device, make sure that the physical device can be connected to the computer. My computer and mobile phone use the same network, which is easier to connect.
Do not remove the debugging code before putting it into the production environment. Otherwise, the app will easily die.

Now open the Cordova app

Open Link

Test:

Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.

Related Article

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.