What debugging techniques do you use for iPhone/iPod web development?
Asked Answered
Q

4

6

I'm working on a web application, and we are targeting the iPhone and iPod Touch. I'm familiar with the debugging tools for FireFox and IE (e.g. Firebug and IE Developer Toolbar), but I can't find anything for the iPod. I am not looking forward to using alert as my main debugging tool, especially when I expect mouse events to be one of the major issues.

Is this really the state of the art? What tools do you recommend?

Also, how similar is the html layout on an iPhone to that of Safari running on Windows? On a Mac?

Quarles answered 26/1, 2009 at 21:25 Comment(0)
H
4

The iPhone version of Safari includes a debug console that can be very handy. Settings > Safarai > Developer.

You can also use the Simulator in the iPhone SDK. There's no extra debugging, but it's easier than using a physical device all the time.

You can also use the desktop version of Safari for many things.

Hooves answered 26/1, 2009 at 23:26 Comment(1)
This solution is Mac-only, if I'm not mistaken.Underlayer
U
1

The web tools that target the iPod Touch and iPhone arenas include

[iPhone Remote Debug Console](
http://code.google.com/p/iphonedebug/)

BlackBaud Simulator for Windows

[MobileSafari Simulator](
http://www.testiphone.com/)

[iPhoney](
http://marketcircle.com/iphoney/)

Unthrone answered 16/11, 2009 at 6:9 Comment(0)
K
1

While WebKit has a remote inspector, it is hard to enable on an actual iOS device (at least without jailbreak) and so most tools for it are simulator-only. iWebInspector looks promising for this, but keep in mind the simulator's WebKit library is not identical to the device's.

That's where weinre comes in. With weinre, you can "debug a web page displayed on your phone from your laptop". How it works is you run its custom HTTP server that hosts two things:

  • a JavaScript file you include on the page you want to debug
  • an Inspector page that you load on the machine you want to debug from

You start the server e.g. java -jar Downloads/weinre.jar --boundHost -all- --httpPort 4242 and then put a script tag like <script src="http://weinre-server-name.local:4242/target/target-script-min.js"> in the source code for your webpage and load the inspector by navigating to e.g. http://weinre-server-name.local:4242/client. When you load the target page on an iPhone on your local WiFi connection, the connection will show up in the client page on your mainframe and you can use the Inspector tabs to view/edit the page on the iPhone.

It has some limitations (no Javascript breakpoints and such) and can be a little laggy, but overall it's pretty magic.

Knisley answered 12/1, 2012 at 19:10 Comment(0)
S
0

There is also a nice tool called iWebInspector http://www.iwebinspector.com/

Sycamore answered 12/12, 2011 at 9:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.