Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible with Weinre to set javascript breakpoints when debugging iOS webviews

I'm using weinre to debug a phonegap application. However it doesn't seem possible to step through the JS or set breakpoints. Is this at all possible?

like image 540
bradgonesurfing Avatar asked Aug 25 '26 05:08

bradgonesurfing


2 Answers

No, it is not possible to set breakpoints with weinre.

like image 127
Simon MacDonald Avatar answered Aug 27 '26 18:08

Simon MacDonald


No is the correct answer. And the "secret XCode UIWebView" mentioned in the other answer doesn't work any more. BUT ...

You can now throw the Weinre out the window because, with the release of iOS 6, Apple released remote mobile Web Inspector for Safari, and this is HUGE for anyone who's been struggling to debug their iOS mobile apps. Basically you have all the features and power of regular Safari Web Inspector--including Breakpoints--for your mobile apps, including WebView & Phonegap apps. I've used weinre quite a bit, and this makes it completely obsolete for these purposes, since the new remote Web Inspector is a full-featured, native debugger.

Here's how it works (requires a Mac, xCode 4.5+ running an iOS 6 simulator (or an attached iOS 6 device, I think), and Safari 6+ on your Mac:

In your ios6 simulator/device, Settings --> Safari --> Advanced --> Web Inspector --> On (this is On by default in the simulator).

In Safari, access iPhone/iPad Simulator from the Develop menu and see your page. You can enable the Develop menu in Safari's Advanced Preferences if you don't see it.

More discussion at the bottom of: http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers

like image 30
B Robster Avatar answered Aug 27 '26 18:08

B Robster



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!