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.