How to install weinre on Windows 7 64bit OS, Please help

3,937 views
Skip to first unread message

Jitendra Vyas

unread,
Jul 21, 2011, 8:37:21 AM7/21/11
to wei...@googlegroups.com
Hi,

OS : Windows 7 64 bit
Browser : Apple Safari (Windows) and  Google Chrome
Java version: 

iPad with iOS 4.3.4

I'm making a Web site for iPad so I want to see instant changes of CSS on my iPad url like I can see with Chrome Developer Tools on my PC. 

I've Webserver (XAMPP) in my PC and my website's files are in htdocs folder. http://localhost/test/index.html

I can also open my local file on my iPad by using this url http://192.168.1.106/test/index.html

I want to debug CSS of  webpage in my Google Chrome Developer tools and changes should be seen in iPad , without saving the actual file



then I extracted weinre.jar in my PC's E: drive. e:\weinre.jar



Then I ran the this command java -jar path/to/weinre.jar in dos prompt 



Now what would be the next step? Help me to setup.

Patrick Mueller

unread,
Jul 21, 2011, 11:21:30 AM7/21/11
to weinre
You're almost there.

To allow your web page to access the weinre server, you will need to
add an option to bind the server to all your network interfaces. To
do this, instead of running

java -jar e:\weinre.jar

use

java -jar e:\weinre.jar --boundHost -all-

Instead of having to enter this option all the time, you can create a
"server.properties" file in a folder named ".weinre" in your "home"
directory. For Windows, your "home" directory is usually "C:
\Documents and Settings\<yourUserId>". In that "server.properties"
file, you'd enter the line:

boundHost: -all-

This is documented here:

http://phonegap.github.com/weinre/Running.html

From the same machine you are running the server on, open a WebKit-
based browser (Safari or Chrome), and go to:

http://localhost:8080/

From there, there's a link to the "debug client user interface" which
is the debugger itself.

You will then need to insert a <script> tag into your application. In
your case, it would look like this:

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

Reload your application to get the new script loaded, and you should
see it connect to the "debug client user interface".

On Jul 21, 8:37 am, Jitendra Vyas <jitendra....@gmail.com> wrote:
> Hi,
>
> *OS : Windows 7 64 bit*
> *Browser : Apple Safari (Windows) and ** Google Chrome*
> *Java version: *
>
> <https://lh6.googleusercontent.com/-H473tuxyxq8/TigbeHV1SKI/AAAAAAAAD0...>
> *iPad with iOS 4.3.4*
>
> I'm making a Web site for iPad so I want to see instant changes of CSS on my
> iPad url like I can see with Chrome Developer Tools on my PC.
>
> I've Webserver (XAMPP) in my PC and my website's files are in *htdocs*
>  folder. *http://localhost/test/index.html*
> *
> *
> I can also open my local file on my iPad by using this url* **http://192.168.1.106/test/index.html*
> *
> *
> I want to debug CSS of  webpage in my Google Chrome Developer tools and
> changes should be seen in iPad , without saving the actual file
>
> I downloaded this Jar file from this
> linkhttps://github.com/downloads/phonegap/weinre/weinre-jar-1.4.0.zip
>
> then I extracted weinre.jar in my PC's E: drive. *e:\weinre.jar*
> *
> *
>
> <https://lh3.googleusercontent.com/-96hBQiKX9ro/TigcPrIMwbI/AAAAAAAAD0...>
> *
> *
> *
> *
> *Then I ran the this command *java -jar path/to/weinre.jar *in dos prompt *
> *
> *
>
> <https://lh6.googleusercontent.com/-MnKjCDiiGzM/TigcLg0LemI/AAAAAAAAD0...>
> *
> *

Jitendra Vyas

unread,
Jul 21, 2011, 12:05:07 PM7/21/11
to wei...@googlegroups.com
In Windows 7 64bit I don't have Documents and Setting folder

But I have C > Users > Jitendra

and when I tried to make a folder called .weinre

I'm getting this error


Jitendra Vyas

unread,
Jul 21, 2011, 12:22:51 PM7/21/11
to wei...@googlegroups.com
And I'm also using XAMPP ( Apache + PHP +MySQl server) 



Do i need this or I should turned off this to use Weinre?



Patrick Mueller

unread,
Jul 21, 2011, 12:24:42 PM7/21/11
to weinre
Looks like Windows does not want to let you create a directory with a
"." in the beginning of the name, via Windows Explorer.

Use the command prompt instead.

On Jul 21, 12:05 pm, Jitendra Vyas <jitendra....@gmail.com> wrote:
> In Windows 7 64bit I don't have *Documents and Setting folder*
> *
> *
> But I have* C > Users > Jitendra*
> *
> *
> and when I tried to make a folder called* **.weinre*
>
> I'm getting this error
>
> <https://lh4.googleusercontent.com/-4Kk5VyFIXWg/TihOGOHb1qI/AAAAAAAAD0...>

Patrick Mueller

unread,
Jul 21, 2011, 12:26:14 PM7/21/11
to weinre
The weinre server, by default, runs on port 8080. I have no idea what
port XAMPP is running on, but it's probably 80. As long as XAMPP
isn't using the same port as weinre, you shouldn't have any problems.
> <https://lh5.googleusercontent.com/-xV-ZdTBiCyg/TihSKVYn8xI/AAAAAAAAD0...>

Jitendra Vyas

unread,
Jul 21, 2011, 12:28:35 PM7/21/11
to wei...@googlegroups.com

Apache (HTTP):use Port 80

Jitendra Vyas

unread,
Jul 22, 2011, 1:41:15 AM7/22/11
to wei...@googlegroups.com
Instead of having to enter this option all the time, you can create a 
"server.properties" file in a folder named ".weinre" in your "home" 
directory.  For Windows, your "home" directory is usually "C: 
\Documents and Settings\<yourUserId>".  In that "server.properties" 
file, you'd enter the line: 
    boundHost: -all- 


Now I have made a Folder called .weinre file named server.properties and I added boundHost: -all-  in the file.



Now is it mean that I don't need to run dos command java -jar weinre.jar -httpPort 8081 ?

Jitendra Vyas

unread,
Jul 22, 2011, 2:50:54 AM7/22/11
to wei...@googlegroups.com
And I'm opening a file from local host http://localhost/skarp/mofomo/ipad/index.html using XAMPP and I've also added JS in head

But it's not connecting to Debug client

What I'm doing wrong?

Jitendra Vyas

unread,
Jul 22, 2011, 3:37:35 AM7/22/11
to wei...@googlegroups.com
Good News. Now I'm able to connect to debug url but it only works on my PC.

when i open url on my iphone it doesn't show the DOM changes.

When I use


it's work fine on local PC but not on my iPhone

and when I use 


it's doesn't work anywhere.

Patrick Mueller

unread,
Jul 22, 2011, 4:32:09 AM7/22/11
to weinre
On Jul 22, 3:37 am, Jitendra Vyas <jitendra....@gmail.com> wrote:
> Good News. Now I'm able to connect to debug url but it only works on my PC.
>
> when i open url on my iphone it doesn't show the DOM changes.
>
> When I use
>
> <script
> src="http://localhost:8080/target/target-script-min.js#anonymous"></script>
>
> it's work fine on local PC but not on my iPhone

Totally expected. "localhost:8080" means "the machine you are
currently running on". So that URL will be pointing to the weinre
server when you view the page in a browser that's running on the same
machine the weinre server.

When you view that page on an iPhone, "localhost:8080" is the iPhone.
You're not running a server on your iPhone. So that's not going to
work.

> and when I use
>
> <script
> src="http://192.168.0.100:8080/target/target-script-min.js#anonymous"></script>
>
> it's doesn't work anywhere.

You need to replace "192.168.0.100" with the ip address of the machine
running weinre server. Open a command prompt in windows and type
"ipconfig".
Message has been deleted

Patrick Mueller

unread,
Jul 22, 2011, 4:40:15 AM7/22/11
to wei...@googlegroups.com
Please stop posting images, at least the way you're doing it.  It's a pain to look at these.

If you paste in the text of the ipconfig command here, instead of an image, I'll respond.

On Fri, Jul 22, 2011 at 04:35, Jitendra Vyas <jitend...@gmail.com> wrote:
This is my ipconfig
Which ip i need to use to get work in Local and mobile device both?

--
Patrick Mueller
http://muellerware.org

Jitendra Vyas

unread,
Jul 22, 2011, 4:43:21 AM7/22/11
to wei...@googlegroups.com
OK. Thanks for suggestion. I just thought pictures give more idea.


This is my ipconfig


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\jitendra>ipconfig

Windows IP Configuration


Wireless LAN adapter Wireless Network Connection:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::95d6:2b9d:b394:65f5%12
   IPv4 Address. . . . . . . . . . . : 192.168.0.102
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.0.1

Ethernet adapter Local Area Connection:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::e162:abac:650e:f672%10
   IPv4 Address. . . . . . . . . . . : 192.168.0.100
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.0.1

Tunnel adapter Local Area Connection* 15:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{5F7F8DB4-4764-4EB5-A9E7-87E85D56D25F}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter isatap.{78293B44-D642-4E57-8CA3-F93110CC64A8}:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Tunnel adapter Teredo Tunneling Pseudo-Interface:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2001:0:4137:9e76:2063:771:8553:d179
   Link-local IPv6 Address . . . . . : fe80::2063:771:8553:d179%17
   Default Gateway . . . . . . . . . : ::

C:\Users\jitendra>

Patrick Mueller

unread,
Jul 22, 2011, 4:57:26 AM7/22/11
to weinre
It looks like 192.168.0.102 and 192.168.0.100 are your ip-addresses,
so that's what you would use. Either one. But you said you tried
192.168.0.100. Is your iPhone connected to your wifi? How are you
accessing your XAMPP server from your iPhone?

On Jul 22, 4:43 am, Jitendra Vyas <jitendra....@gmail.com> wrote:
> OK. Thanks for suggestion. I just thought pictures give more idea.
>
> *This is my ipconfig*
> *
> *
> *
> *
> *
> *

Jitendra Vyas

unread,
Jul 22, 2011, 5:00:31 AM7/22/11
to wei...@googlegroups.com
I've tried both 192.168.0.102 and 192.168.0.100 both are not working.

Yes I'm opening my local file on mobile using XAMPP.

My XAMPP server is on and I can open my file on my iphone using this url http://localhost/skarp/mofomo/ipad/index.html

If I stop XAMPP then I cannot open my local file on my iPhone.

Jitendra Vyas

unread,
Jul 22, 2011, 5:02:40 AM7/22/11
to wei...@googlegroups.com
Sorry I'm accessing my file on iPhone using these url



both works.

Patrick Mueller

unread,
Jul 22, 2011, 5:14:22 AM7/22/11
to weinre
Well, I'm not sure why using

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

doesn't work then. Seems like it should. Anything printed in the
command prompt window where the weinre server is running?

Can you browse to http://192.168.0.100:8080/ on your phone?

What version of iOS are you using on your phone?

Jitendra Vyas

unread,
Jul 22, 2011, 5:18:49 AM7/22/11
to wei...@googlegroups.com
This is in command prompt data


Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\jitendra>java -jar e:\weinre.jar --boundHost -all-
2011-07-22 12:02:41.178:INFO::jetty-7.x.y-SNAPSHOT
2011-07-22 12:02:41.214:INFO::Started SelectChann...@0.0.0.0:8080
2011-07-22 12:02:41.214:INFO:weinre:HTTP server started at http://localhost:8080

IDLE SCEP@44937684      [d=false,io=1,w=true,rb=false,wb=false]
IDLE SCEP@870459580     [d=false,io=1,w=true,rb=false,wb=false]
IDLE SCEP@1888765668    [d=false,io=1,w=true,rb=false,wb=false]
IDLE SCEP@1006753184    [d=false,io=1,w=true,rb=false,wb=false]
IDLE SCEP@138319567     [d=false,io=1,w=true,rb=false,wb=false]
IDLE SCEP@1444239296    [d=false,io=1,w=true,rb=false,wb=false]


http://192.168.0.100:8080/ is not working on my phone

and My iOS version is 4.3.4 (8K2)

Patrick Mueller

unread,
Jul 22, 2011, 5:30:19 AM7/22/11
to weinre
But http://192.168.0.100 is working on your iphone, it takes you to
your XAMPP server, right?

So is http://192.168.0.100:8080 working on your windows machine? You
can see the weinre page from there? I'm guessing it's not, but it
should be. You should see a page from the weinre server.

Dunno. Maybe the code to set the ip address the server is bound to (--
boundHost) isn't working properly in Windows. Pretty sure other folks
have gotten this to run in Windows though.

Jitendra Vyas

unread,
Jul 22, 2011, 5:34:43 AM7/22/11
to wei...@googlegroups.com
Yes my http://192.168.0.100 goes to XAMPP server, you are right.

Should I turned off the XAMPP? But then how i will open the local file on my iPhone?

Jitendra Vyas

unread,
Jul 22, 2011, 5:39:09 AM7/22/11
to wei...@googlegroups.com
And this is the location of my local file in my PC

which I want to open and Debug for Mobile

Patrick Mueller

unread,
Jul 22, 2011, 5:54:06 AM7/22/11
to weinre
On Jul 22, 5:34 am, Jitendra Vyas <jitendra....@gmail.com> wrote:
> Yes myhttp://192.168.0.100goes to XAMPP server, you are right.
>
> Should I turned off the XAMPP? But then how i will open the local file on my
> iPhone?

Again, there is no need to turn off XAMPP.

Patrick Mueller

unread,
Jul 22, 2011, 5:55:43 AM7/22/11
to weinre
Sorry, I don't really know what's going on here. Unless you are
entering that URL, starting with the file:// bit, on your iPhone.
Which won't work.

Perhaps your XAMPP server is caching the file that includes the link
to the weinre target script.

Jitendra Vyas

unread,
Jul 22, 2011, 5:57:46 AM7/22/11
to wei...@googlegroups.com
http://192.168.0.100:8080/ works fine on my PC.


Jitendra Vyas

unread,
Jul 22, 2011, 6:11:48 AM7/22/11
to wei...@googlegroups.com
Can i keep the <script src="target/target-script-min.js#anonymous"> in my local folder

or can't i upload it to internet and use it like this

Patrick Mueller

unread,
Jul 22, 2011, 6:30:11 AM7/22/11
to weinre
So, the script src line should be:
min.js#anonymous>"></script>

not what you entered, with multiple "<" and ">" chars.

And no, you can't keep that script in a local file. It needs to come
from the weinre server. If you can't get the file, because you can't
get to the weinre server, then the file doesn't matter - you need to
be able to connect to the weinre server to use weinre.

It seems like there's something odd with your set up. I can't offer
any more help. Might see if you have a local guru available who can
help out.

Jitendra Vyas

unread,
Jul 22, 2011, 7:05:44 AM7/22/11
to wei...@googlegroups.com
It's working now but it's very slow. It takes time to show changes of Chorme developer topls in mobile 

This is dos

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\jitendra>java -jar e:\weinre.jar --boundHost -all-
2011-07-22 16:26:47.553:INFO::jetty-7.x.y-SNAPSHOT
2011-07-22 16:26:47.588:INFO::Started SelectChann...@0.0.0.0:8080
2011-07-22 16:26:47.589:INFO:weinre:HTTP server started at http://localhost:8080

192.168.0.103 -  -  [22/Jul/2011:10:56:48 +0000] "GET /ws/target/1371709741 HTTP
/1.1" 404 0
2011-07-22 16:27:24.102:INFO:weinre:extensions not enabled: ~/.weinre/extensions
 is not a directory
2011-07-22 16:27:24.619:INFO:weinre:target 159440335: weinre: target 159440335 c
onnected to client 159440336
2011-07-22 16:27:25.632:WARN:weinre:target 159440335: weinre: request for non-re
gistered interface:BrowserDebugger.setAllBrowserBreakpoints()
2011-07-22 16:28:49.056:INFO:weinre:client 159440336: autoconnecting to 15944033
7
2011-07-22 16:28:49.057:INFO:weinre:target 159440335: weinre: target 159440335 d
isconnected from client 159440336
2011-07-22 16:28:53.557:INFO:weinre:target 159440337: weinre: target 159440337 c
onnected to client 159440336
IDLE SCEP@647057258     [d=false,io=1,w=true,rb=false,wb=false]
IDLE SCEP@1335505632    [d=false,io=1,w=true,rb=false,wb=false]
IDLE SCEP@1902942311    [d=false,io=1,w=true,rb=false,wb=false]
IDLE SCEP@1498711626    [d=false,io=1,w=true,rb=false,wb=false]
IDLE SCEP@354199555     [d=false,io=1,w=true,rb=false,wb=false]
2011-07-22 16:33:24.804:INFO:weinre:client 159440336: autoconnecting to 15944033
5
2011-07-22 16:33:25.056:INFO:weinre:target 159440335: weinre: target 159440335 c
onnected to client 159440336


And when I open the nodes of code in Developer tools, it's taking time to open.

Patrick Mueller

unread,
Jul 22, 2011, 8:19:17 AM7/22/11
to weinre
I've seen weinre run slowly on Windows XP before, but thought the
problem was with my box, since I couldn't reproduce the problem. I've
opened an issue:

https://github.com/phonegap/weinre/issues/18

Until I figure it out, not sure what to tell you. Try turning off
virus checkers, etc? Try running it on another box. If you don't
have another physical box, you could try it on a Linux running in
VirtualBox or other VM.

On Jul 22, 7:05 am, Jitendra Vyas <jitendra....@gmail.com> wrote:
> It's working now but it's very slow. It takes time to show changes of Chorme
> developer topls in mobile
>
> This is dos
>
> Microsoft Windows [Version 6.1.7601]
> Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
>
> C:\Users\jitendra>java -jar e:\weinre.jar --boundHost -all-
> 2011-07-22 16:26:47.553:INFO::jetty-7.x.y-SNAPSHOT
> 2011-07-22 16:26:47.588:INFO::Started SelectChannelConnec...@0.0.0.0:8080
> 2011-07-22 16:26:47.589:INFO:weinre:HTTP server started athttp://localhost:8080

Robert Schmuecker

unread,
Apr 13, 2012, 9:34:37 AM4/13/12
to wei...@googlegroups.com
Just as a note for future reference,

I was successful in getting this to work with my device via WIFI by specifying the local IP of my development machine running the debugger client.  i.e.
java -jar weinre.jar --boundHost 192.168.0.104

For some reason on my machine it wouldn't work binding all hosts - I think perhaps due to the fact that I've got some reduntant VM hosts lurking around.  In anycase when testing on an actual device this is the only way so far that I have found to work as even though my device is connected via USB I can't get it to connect to the host computer other than over it's wifi connection?

Hope this helps at least somebody!

R.

Patrick Mueller

unread,
Apr 13, 2012, 12:19:54 PM4/13/12
to wei...@googlegroups.com
On Friday, April 13, 2012 9:34:37 AM UTC-4, rob1308 wrote:
Just as a note for future reference,

I was successful in getting this to work with my device via WIFI by specifying the local IP of my development machine running the debugger client.  i.e.
java -jar weinre.jar --boundHost 192.168.0.104

For some reason on my machine it wouldn't work binding all hosts - I think perhaps due to the fact that I've got some reduntant VM hosts lurking around.

Huh.  Yeah, would be good to know why that doesn't work.  Maybe it's a Windows thing?  Having VM "magic ip interfaces" shouldn't really be a problem, I don't think.

There used to be this old lurking problem in windows if you ever bound to 0.0.0.0, even implicitly, where the OS would take forever to try to DNS resolve the address.  Never understood that one. Easily fixable by adding 0.0.0.0 to your hosts file with a dummy name.  The problem was especially bad because DNS APIs almost always block, so you get these interminable waits at odd times.  That may be (or was) the issue with "weinre on windows runs very, very slowly" that I've seen from time-to-time.
 
In anycase when testing on an actual device this is the only way so far that I have found to work as even though my device is connected via USB I can't get it to connect to the host computer other than over it's wifi connection?

Since weinre only uses http for communication between the target-server-client, you'll need ip connectivity at those two boundaries.  I believe Android can funnel ip traffic over it's ADB connection over USB, but ... you'll have to configure it a tiny bit.  Don't think that'll work for Apple gear.  Other devices/SDKs/connectors, who knows.

Going over wireless on the device is usually the thing that will always work.  If you're doing wireless via your telco service (eg, your phone's connection to Verizon vs wifi), then you have an additional problem of opening a server port that your phone can see, esp problematic if your server is behind a company firewall.

Reply all
Reply to author
Forward
0 new messages