Here is an overview of how to use the Web Inspector Tools to debug the Safari browser on the iPhone. You can also debug on an actual iPhone but the simulator that comes with Xcode should be sufficient in most situations. Below you will find the instructions on how to debug using the iOS Simulator.
- Mac OSX Lion (10.7.4) or higher
- Safari 6
- Xcode 4.5 or higher iOS6 SDK (available in the app store)
- Open up the Xcode App. Right click on the Xcode icon and navigate to the iOS Simulator app. Open the Safari app and navigate to the URL you need to debug.
- Open up Safari 6 and ensure you have the developer tools in Safari turned on.
.
If you can't see the "Develop" in the menu bar, click "Safari > Preferences > Advanced" and select the "Show develop menu in the menu bar" checkbox.
- On your mac's Safari use the "Develop" menu to navigate to the "iPhone Simulator" option. This will provide you a list of open pages on the iOS Simulator you can now use the developer tools to debug.
- You should now be using inspecting the browser on the iOS Simulator.