Debugging

The build process creates a single, compressed JavaScript file from all of the core MobileViewer script files to reduce the size and quantity of downloads when the application is loaded. This is great for a finished application, but it makes debugging a little tricky.

The solution is to modify the script reference in the main index.html file to load mobileViewer.js instead of mobileViewerSF-compressed.js. This will result in the individual files being loaded, making it much easier to step through the code in a debugger.

The best tool for debugging on the desktop is probably Firebug, which is an add-on to Mozilla Firefox, though recent versions of other browsers also have developer tools. On the Apple iPhone itself, the settings for the Apple Safari app allow the debug console to be enabled (look under the 'Developer' menu in the settings) which is useful in determing errors that cannot be reproduced on the desktop.