6

Instructions for running weinre state that I need to insert following script:

<script src="http://a.b.c:8081/target/target-script-min.js"></script>

where http://a.b.c is my server IP or host name.

Couple of questions:

Does this mean that I must open port 8081 on my remote server?

Also what is the target-script-min.js? It looks like I need to upload it to a target folder?

dev.e.loper
  • 35,446
  • 76
  • 161
  • 247

4 Answers4

13

The way you start the weinre sever is by running the command

weinre

in your command line. And then you leaving it running for as long as you're still using weinre. You have options for this command that you can find by type weinre --help, but the important ones are --boundHost, and --httpPort. --boundHost defaults to localhost and --httpPort defaults to 8080. So run

weinre --boundHost 192.168.1.2

where 192.168.3.4 is your ip address, which you can find by running ipconfig. Put the following in your code:

<script src="http://192.168.1.2:8080/target/target-script-min.js#whatever"></script>

Then, in your browser, go to

http://192.168.1.2:8080/client/#whatever

I wrote a blog post about it here: https://adam.garrett-harris.com/how-to-setup-remote-debugging-in-phonegap

To answer your second question, the target-script-min.js is just a javascript file that's a part of weinre whenever you install it. When you have weinre running, you can visit

http://192.168.1.2:8080/target/target-script-min.js

to see the file if you want.

aharris88
  • 3,560
  • 3
  • 27
  • 45
  • This link http://www.adamwadeharris.com/setup-remote-debugging-phonegap/ redirects me to http://www.adamwadeharris.com/ – Piyush Feb 25 '19 at 08:26
  • Sorry, I'll change the link. It's now at https://adam.garrett-harris.com/how-to-setup-remote-debugging-in-phonegap – aharris88 Feb 25 '19 at 23:24
2

The weinre server is "started" by executing this command weinre --boundHost a.b.c.d where a.b.c.d stands for the local IP of the desktop used for debugging. The port 8080 will be opened (default port, but you may configure an other one).

At this point, the script http://a.b.c.d:8080/target/target-script-min.js becomes available on your local network, and may be called by your application located on an other device in the same local network.

If your application or tested web page call this script, it will be seen by your desktop.

Therefore, you don't have anything to upload on your target...

Yako
  • 3,405
  • 9
  • 41
  • 71
1

Weinri debug resume

After successfully installed weinri,

1 - Run this command with your ip address:

  weinre --boundHost 192.168.12.3

2 - Attach in your code header:

<script src="http://192.168.12.3:8080/target/target-script-min.js#anonymous"></script>

3 - Access your website in your tablet or whatever device

3 - Get the wenri debug screen on:

   http://localhost:8080/client/#anonymous

Obs: 'anonymous' word can be replaced by another of your choice.

Fillype Farias
  • 622
  • 1
  • 8
  • 20
0

if you can't debug your html page even after completing all of the steps mentioned in the Nokia Developer Article, then check your windows firewall settings.Please be sure that the firewall setting for private network is TURNED OFF ..

windows 8.1 firewall settings window