Search code examples
androidcordovatargetweinre

Weinre do not show target for Cordova Android App running on handphone


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.


Solution

  • 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.