Debugging Mobile Safari Applications


I'm continuing to work on RinkAtlas for iPhone to make it more iPhone-friendly. This required me to get serious about using the tools that Safari and Mobile Safari provide to help developers debug web applications.

Although I am not a Safari web app debugging expert by any stretch of the imagination, I thought I'd share some of the things I've found useful so far.

  • Safari FAQ from Apple Developer Connection: This might be the jumping off point for most web developers who are trying to track down an issue with how a web app renders in Safari or Mobile Safari.

    Probably the most useful portion of the FAQ is How do I debug JavaScript in Safari? which talks about displaying the "Develop" menu, a treasure-trove of little hacks.


  • Chapter 12 of Professional iPhone and iPod touch Programming: Building Applications for Mobile Safari by Richard Wagner: I mentioned this book from WROX in my last Inside iPhone post. It's probably the most comprehensive book on developing iPhone-friendly web apps. Chapter 12 gets into revealing the iPhone and iPod Touch Debug Consoles, as well as using the Safari Debug Menu, the Safari Web Inspector, JavaScript Console, and installing and using Drosera.

    This chapter also goes into detail about simulating Mobile Safari on your desktop including changing the User Agent string and the window size, and using iPhoney which is an open source iPhone web simulator for use by designers.


  • Big Book of Apple Hacks by Chris Seibold: This book's section on enabling the Debug menu in Safari (Hack 10) illustrates the effect of changing several settings including changing the User Agent string. I think a lot of the iPhone-specific stuff in this book revolves around jailbreaking, which may or may not be your cup of tea.

  • Multi-Safari: A friend of mine pointed this site out to me a week or so ago. It's an archive of historical versions of Safari teamed with the original versions of Webkit that came with them. This can be incredibly useful for testing incompatibilities that have been fixed by subsequent versions of Safari.

    Note that this site only archives versions of the Safari desktop application, not Mobile Safari. I think that its potential value to a web developer was so great that it deserves a mention here anyway.


I'll add more resources to this article as I find them.

If you have any tips, utilities, or sites that have helped you debug Mobile Safari web apps, please post them as comments.

AddThis Social Bookmark Button
Comments (4)

4 Comments

Chapter 8 of "iPhone in Action: Introduction to Web & SDK Development" at manning.com/callen is on web debugging. It is available now if you buy the advance PDF edition.

If you'd like a review copy of the chapter, let me know.

Al said:

I use Firebug in Firefox often for debugging my iphone web apps. I found that iUI web apps work well in firefox

http://getfirebug.com/
that coupled with Firebug's Error Console were often enough to figure out issues.

my apps are at:
http://imoviemash.com
http://imusicmash.com

Al

Dave Aiello said:

Christopher:

Thanks for pointing Chapter 8 of your book out to me.

I see that you and Shannon Appelcline gave a great deal of attention to web app development in "iPhone in Action: Introduction to Web & SDK Development". That's wonderful. I'll definitely add a reference to it to the body of this post.

murli said:

The bidders all past the entry criteria which required a minimum roll out strategy as well as a commitment to ensure that at least 30% of the equipment used is manufactured locally.