3

Hy I am trying to configure weinre to debug phonegap apps on Android 4.0, 4.1, 4.2 and 4.3.

From what I have read online I have to run the the weinre server on my local ip so I runed the following (xxx.xx.xx.xx will represent my computers ip address):

weinre --boundHost xxx.xx.xx.xx --httpPort 8081

I got the message back:

weinre: starting server at http://xxx.xx.xx.xx:8081

I then went to the following url: http://xxx.xx.xx.xx:8081/client/

This opened the weinre page with the follwing:

enter image description here

I then enable USB debugging on my Android device.

I added this script at the bottom of my index.html:

<script src="http://xxx.xx.xx.xx:8081/target/target-script-min.js#anonymous"></script>

I deployed the app and I got this error:

The connection to the server was unssuccessfull((file:///android_assest/www/index.html)

This only happens when I add the weinre script.

I should mention that I am trying to debug threw cabe I assume that this is the way to do it.

Also I have also tryed using localhost but for some reason when I add the script with localhost in it and I run the app it does not brake but also no connection to the weinre client gets create after refresh of the client.

Anyone know what can be wrong?

aleczandru
  • 5,319
  • 15
  • 62
  • 112

1 Answers1

0

Weinre uses normal HTTP client/server communication. So you don't need to connect your device via USB cable nor enable USB debugging on it. Just make sure that you can access the weinre server from your device.

If you can't access the weinre server URL using the browser on your Android device while being connected to the same wireless network then you probably have a firewall or port filter on your PC preventing that.

HHK
  • 4,852
  • 1
  • 23
  • 40