You can easily debug your web application on both device (iPhone and iPod Touch) and desktop computer following these simple steps.

On device debugging

With newer version of the iPhone and iPod Touch firmware, starting with 1.1.2 (TODO: to be confirmed ?), you have access to a developer console right in Safari browser. To activate it, go to Settings, Safari, scroll down and tap the last option Developer, set Debug Console to ON.

You'll then have a new banner under the address bar of Safari showing number of errors, tips or simple messages. Tap on it to show list of messages. If you want to show your own debugging informations, instead of the good old alert(...) functions, you can use:

console.log(message);	// Simple message, no icon
console.warn(message); // Warning message, with yellow warning icon
console.error(message); // Error message, with red error icon

Desktop debugging

You can use the desktop version of Safari, available from Apple web site for both Windows and Mac, or Firefox with Firebug also available on both platforms.

You can use then the same function as exposed with "On device debugging".

TODO: be abit more specific
Saturday, 20-Jun-2009 14:39:41 CEST