Showing posts with label mobile development. Show all posts
Showing posts with label mobile development. Show all posts

Remote Firebug-like web content debugging for your mobile device

Debugging browser quirks on your mobile device is a pain in the ass. There's no such Firebug or developer console or anything nice like their desktop counterparts.

The ability to quickly modify CSS on the fly easily saves hours of work. If only we had something like that for mobile web dev...

f8Uf8FH
One could go mad debugging mobile CSS quirks...

One option is to use Firebug Lite, but to be honest, screen space is valuable and I personally would not be stuffed typing in names of CSS style properties on an on-screen keyboard.

In comes weinre to the rescue. This unfortunately named tool stands for WEb INspector REmote and is supposed to be pronounced "winery", but I always end up calling it "weener".

This gives you remote access to the content in the browser, via a another browser. It's as close as we'll get to a remote web Firebug for now.

Installation

I'm sorry to say but we'll need NodeJS for this. At time of writing I installed v0.10.18.

  • Download and install NodeJS.
  • Now open up the normal Windows Command Prompt (not the NodeJS one)
  • Type in:

npm -g install weinre

  • This installs weinre (v2.0.0-pre-HH0SN197 at time of writing)

Setup and debugging

  • Once it's all done, type:

weinre --bound -all-

  • Ensure that there are no firewall rules blocking this service (node.exe, allow inbound on port 8080 - such as uTorrent)
  • Edit your HTML and add this script into the <head> tag

<script src="http://YourWeinreIP:8080/target/target-script-min.js"></script>

  • Open up a desktop browser page to http://YourWeinreIP:8080/client
  • Load your test page on the mobile device and it should appear in the client list under "Targets"

image

  • Click on the link for the target so it turns green
  • Click "Elements" in the top menu
  • You should now see a familiar Chrome/Firebug style element tree and a CSS panel on the right.
  • The rest (resources, network, timeline, console) should be fairly straight forward.
  • Enjoy =)

Sources

Mobile Phone Development: Detailed list of phone capabilities and technical specifications

Creating a mobile phone application (or mobile friendly website) can be an absolute pain in the ass. Each phone has a slight variation in what it does and does not support.

There is a handy database for mobile phone (or as the yankees call them, "cell phone") specifications called WURFL.

The configuration file they provide lets you know capabilities of a phone such as what HTML support, CSS, Ajax, display size and color depth, image/audio/video formats supported, storage method, streaming support, MMS, J2ME and Flash/PDF support.

Not to mention the basics such as manufacturer name, model, keyboard type, operating system and wireless capabilities.

The documentation page is a bit difficult to find, but linked here (mainly for my own reference).

Be warned, it is a comprehensive list so it takes quite some time to process it. You should not be accessing it on a per view basis.

[ WURFL site ]

 
Copyright © Twig's Tech Tips
Theme by BloggerThemes & TopWPThemes Sponsored by iBlogtoBlog