0

I really need some help here...

I have developed a simple app using cordova and I wish to debug the app using weinre for further improvement.

The problem is when i host weinre client and access with browser to http://192.168.0.111:8080/client/#anonymous the app does not show as a target in the client..

I have insert this script import line at the last part of my index.html

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

In config.xml, i put <access origin="*" /> and in AndroidManifest.xml, i put <uses-permission android:name="android.permission.INTERNET" />

I have also try to open my index.html with the browser of computer which hosting weinre and it's been indicate as a target. Which mean the code should be working fine.

I have also try to access http://192.168.0.111:8080 and the weinre info page is showing up. which mean the ip is correct and accessible from my handphone.

but I wonder why when i run the app, weinre dint show my app as a target. Do I miss out some important step to allow my app to be accessible?

Please help.

TienPing
  • 51
  • 3
  • Just to be sure, have you done [all configuration on your phone](https://developer.chrome.com/devtools/docs/remote-debugging) as required? – Kenny Ki Mar 05 '15 at 09:40
  • What command line are you using to start the weinre server? – QuickFix Mar 05 '15 at 17:19
  • Kenny, I have enable USB debugging, and connecting to my phone with USB cable. But when i open "chrome://inspect", it says "No devices detected". any idea what I have missed? – TienPing Mar 06 '15 at 05:04
  • QuickFix, i use this command "weinre --boundHost -all-" – TienPing Mar 06 '15 at 05:04
  • @TienPingLim in that case you can answer your own question and accept it. – Kenny Ki Mar 09 '15 at 09:18
  • actually, i still cant connect and show target with weinre... anyways, i tried the [Remote Debugging on Android with Chrome](https://developer.chrome.com/devtools/docs/remote-debugging) from the link that kenny share, and it work perfectly for me. and i'm more familiar with this interface as well. **thanks kenny :D** – TienPing Mar 09 '15 at 17:34

1 Answers1

2

After all I still cannot identified the issue, it might be configuration issue and it might not... any suggestion or answer will be welcome.

and to provide solution for those who have similar situation as me, you can try this https://developer.chrome.com/devtools/docs/remote-debugging.

It's working fine for my case. Besides, it's much easier to setup and more familiar interface. You can even step through your js line by line just like what you can do with your pages.

for the moments, this is the best solution i can get.

TienPing
  • 51
  • 3
  • weinre was built back in the time when we didn't have remote debuggers of any kind for mobile. Today we do, and you've found the best debugger - the native debugger for web views for Android. You should be using that debugger today, instead of weinre. – Patrick Mueller Apr 08 '15 at 00:49