1

I am using phonegap and looking for a debugger for my javascript during the whole afternoon, but still couldn't find the solution. I have Weinre installed on my Mac, I succeeded in running the server by executing "weinre" on terminal. I have an app installed on my iphone 4(running iOS 5.1), then I have included the script in my index.html like this :

<script type=”text/javascript” src="http://localhost:8080/target/target-script-min.js#anonymous"></script>

But on the Weinre client, I can't see any target connected. I have succeeded in seeing the content of my webpage one time when I used debug.phonegap.com for debugging this afternoon. Any idea on how to fix it ? Perhaps it is a network problem? I have tried to connect my iphone to Mac by usb and also connect the iphone and the Mac to the same WIFI access point.

Thanks in advance!

Mathieu
  • 1,491
  • 5
  • 17
  • 37
  • I know this is an old post, but just to state the obvious, 'localhost' when executing on your phone will be the phone's local system, as mentioned on http://people.apache.org/~pmuellr/weinre/docs/latest/Running.html "you can't use the default localhost value for the --boundHost option. Instead, you will need to specify a host name / ip address with the --boundHost option." .. so I run weinre with: `weinre --boundHost 192.168.1.6` where 192.168.1.6 is my computer's IP address, which the mobile device can talk to via wifi, then put `192.168.1.6` instead of `localhost` in your `script` tag. – Neek May 09 '17 at 07:04

3 Answers3

0

If you can update your iPhone to iOS 6 and Safari 6 on Mac, you can use safari on Mac to debug your mobile website or PhoneGap app: http://webdesign.tutsplus.com/tutorials/workflow-tutorials/quick-tip-using-web-inspector-to-debug-mobile-safari/

its very easy and hassle free compared to using Weinre.

Nishanth Nair
  • 2,975
  • 2
  • 19
  • 22
  • That works, but it seems that if I try to reinstall the app without closing the inspector before that, Safari won't be happy and will close itself... – Mathieu Mar 08 '13 at 16:23
  • Yes. everytime you need open up the dev tools. But don't you think its much much better than weinre? ;) – Nishanth Nair Mar 08 '13 at 16:52
  • 1
    this does not answer the question. OP asked for weinre not remote safari debugging. – Aras Dec 12 '13 at 21:59
  • After Safari 6 is released, u dont really need weinre for debugging. The answer was to go with a better option. – Nishanth Nair Dec 12 '13 at 22:46
0

You could also try PhoneGap Build. https://build.phonegap.com/people/sign_up

Free for one project, and you just need to zip up and upload your pre-existing www directory, providing it doesn't use any plugins. It has a "debug" button which runs weinre on a remote server for you.

Has been very useful for me as my web inspector tends to be inconsistent in recognising devices.

-1

it might be easier to use Adobe Edge Inspect.

Vlad Stirbu
  • 1,732
  • 2
  • 16
  • 27