Android Development Series ten Cordova Architecture Learning weinre Remote Debugging technology

Source: Internet
Author: User

The page on the phone is not as easy to debug as desktop development. You can use weinre for remote debugging to facilitate development. This article describes installation and use under Windows.

Installation

With NPM installation, you can run:

NPM install-g weinre

The installation path may be like this:

Input command

Weinre
Can be started.

To open a URL using your browser:
http://localhost:8080

We recommend using Chrome.

If you have a firewall, be aware that you need to allow 8080 port data to pass.

You can now connect the Cordova program for debugging. Put the following code in the index.html.

<script src="http://你的pc的ip:8080/target/target-script-min.js"></script>

If you use an emulator, you can set the IP to localhost. Except for Android emulator, you need to set the IP to 10.0.2.2.
If you are using a physical device, it is a bit more complicated to make sure that the physical device can connect to the computer. My computer and mobile phone use the same network, more easy to connect.
It is not necessary to remove the debug code before putting into production environment. Otherwise the app will die easily.

Now open the Cordova app

Open link

Test:

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android Development Series ten Cordova Architecture Learning weinre Remote Debugging technology

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.