Web Inspector Debugging for iPhone and iPad from Mac OS X
To get started you need the latest version of Xcode 4.5 to run iOS 6 on the iPhone and iPad simulator and Safari 6 installed on your Mac. Currently Safari 6 is available for Lion and Mountain Lion.
Once you have the iOS 6 simulator and Safari 6 installed and running, click on the Develop menu of Safari 6 and you should now see iPhone Simulator or iPad Simulator menu item listing all the webpages that are available to debug in Mobile Safari via Safari 6 Web Inspector. You will also see native apps show up in this menu item if the application is running and you can debug UIWebView using this method as well.