I have a strange behavior on the iPhone browser. Is there a tool to debug the JavaScript of the iPhone browser?
I'm hoping there's something more advanced than simple alert()
messages. Is there something with advanced tools like setting breakpoints and viewing object states?
From the Safari menu bar, select Develop and choose the name of your attached iOS device, then select the URL that appears under Safari to open the debug console for that site. After you connect your device, use your Mac to inspect the website you want to debug and have it open in the Safari mobile browser.
To debug JavaScript on the iPad, you need to open the Safari browser. Use a USB cable to connect the iPad to Mac. Safari opens and your iPad now visible in the DEVELOP Menu. After selecting, start debugging JavaScript.
You can enable JavaScript on your iPhone in the Safari section of the Settings app. If JavaScript isn't turned on, many websites will appear broken in your Safari browser. Though JavaScript should be enabled by default, it's important to check that it hasn't been accidentally disabled.
With the release of iOS 6, Apple released Remote Web Inspector for their Mobile Safari, and this is huge. Basically you have all the features and power of Web Inspector in regular Safari, for your mobile apps, including Phonegap apps.
I've used weinre but this tool makes it obsolete for newer versions of iOS (unfortunately not for old versions of iOS, non-iOS devices, or if you're on Windows) since its a full-featured debugger with breakpoints and everything.
In Safari 6+ for Mac, access your page from the Develop menu. You can enable Develop menu in Safari's Advanced Preferences if its not showing up.
More discussion at the bottom of:
http://www.mobilexweb.com/blog/iphone-5-ios-6-html5-developers
(Also, if you read about a "secret private interface" or iWebInspector somewhere, these are also made obsolete.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With