Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
138
rated 0 times [  143] [ 5]  / answers: 1 / hits: 40694  / 13 Years ago, tue, august 30, 2011, 12:00:00

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?


More From » iphone

 Answers
230

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.



Requirements:




  1. A Mac with Safari 6+

  2. Either a USB-attached iOS 6+ device or xCode 4.5+ running an iOS 6+ simulator



How to activate the inspector:




  1. In your simulator or device, open Settings > Safari > Advanced > Web Inspector > On

    (this is on by default in the simulator)

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



    Safari



    enter




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


[#90350] Sunday, August 28, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rossthomasn

Total Points: 122
Total Questions: 78
Total Answers: 105

Location: South Georgia
Member since Sun, Aug 8, 2021
3 Years ago
rossthomasn questions
Wed, Mar 16, 22, 00:00, 2 Years ago
Wed, May 5, 21, 00:00, 3 Years ago
Thu, Nov 26, 20, 00:00, 4 Years ago
Sun, May 31, 20, 00:00, 4 Years ago
;