The simplest way to debug web applications on iOS is to enable remote debugging with Safari on your Mac. If you don't have a Mac, skip ahead to the Debugging on Anything section.




We just enabled some pretty powerful debugging capabilities for our mobile application development. In the first step, we turned on the Web Inspector option that lets us access debug information for the current web browser process in Safari. In the second step, we enabled the Developer menu for Safari on a Mac computer. Finally, when we connect an iOS device to a Mac computer with a USB cable, we can use Safari's web debugging capabilities with the mobile Safari browser.
Depending on your version of Safari, Web Inspector might appear differently. In any case, Web Inspector has basically the same capabilities as those of Chrome Developer Tools, which were introduced in Chapter 2, Key Concepts in OpenLayers, and you have full access to inspect the HTML created for your application, change CSS styles dynamically, run JavaScript code, and view logfiles.