debugging mobile web apps

for: GOTO Nights Chicago - January 22 2013

by:   Patrick Mueller
@pmuellr
http://muellerware.org/

etc

canonical links to presentation

other mobile debugging presentations by me

slide template

last modified

what

This presentation will cover:

what is a 'mobile web app'?

debug tools by platforms

RIM

first mobile platform vendor to ship real remote Web Inspector implementation from WebKit

links

iOS

Real remote Web Inspector like Safari 6 Web Inspector

links

Android

Real remote Web Inspector like Chrome Dev Tools

links

Windows

???

Ongoing work to get weinre running on Windows Phone.

Boot to Gecko / Firefox OS

Runs applications implemented entirely in HTML, CSS and JavaScript. [link]

Also see the slide on r2d2b2g in this presentation.

links

debugging tools for platform simulators

ripple

Chrome extension allowing you to quickly see how your application looks and functions on multiple mobile devices and platforms.

links

r2d2b2g

Firefox extension to run the Boot to Gecko desktop and apps within Firefox.

links

platform agnostic debugging tools

jsbin

From the web site:

JS Bin is a webapp specifically designed to help JavaScript and CSS folk test snippets of code, within some context, and debug the code collaboratively.

links

aardwolf

From the web site:

Aardwolf is a remote JavaScript debugger for iPhone / Android / WindowsPhone 7 / BlackBerry OS 6+. It is written in JavaScript.

links

jsfiddle

Popular HTML, CSS, JavaScript snippet testing environment

links

Adobe Edge Inspect

Preview and inspect web designs on mobile devices.

links

rsprofiler

proof-of-concept project for extracting and displaying dtrace-ishly precise JavaScript performance profiling

links

rsprofiler demo source

function run() {
    rsprofiler.start("jquery profile")
    runTests()
    rsprofiler.stop(function(err) { ... })
}

function runTests() {
    for (var i=0; i<40; i++) { runTestsDiv1(); runTestsSpan1() }
}

function runTestsDiv1() {
    for (var i=0; i<1000; i++) { $("#div-1").text() }
}

function runTestsSpan1() {
    for (var i=0; i<1000; i++) { $("#span-1").text($("#span-1").text()) }
}
                

rsprofiler demo flame graph

Hover over a box! Click a box!



            

weinre

links

weinre tips and tricks

For issues with Cordova, PhoneGap, Worklight:

demo time!

weinre movies here:

old rsprofiler movie here:

contribute to weinre!

how weinre works

weinre is a web server

targets connect by:

clients connect by:

server supports CORS so that target can XHR to a cross-origin host (the weinre server)

client and target use long-polling to enable messaging to/from the server

weinre connections

M targets connected to N clients

example messages sent

Messages defined as functions described in WebIDL.

example message interface

module weinre {

    interface WeinreTargetCommands {

        void registerTarget(int url, out string targetId);

        void sendClientCallback(string callbackId, Object args);

        void logDebug(   in string message );
        void logInfo(    in string message );
        void logWarning( in string message );
        void logError(   in string message );

    };

}
                

lots of messages sent quickly, sometimes

things replaced

window.clearInterval() window.clearTimeout() window.setInterval() window.setTimeout()

window.addEventListener() Node.addEventListener()

XMLHttpRequest.open() XMLHttpRequest.send() XMLHttpRequest.addEventListener()

window.openDatabase() window.console()

LocalStorage.setItem() LocalStorage.removeItem() LocalStorage.clear()

SessionStorage.setItem() SessionStorage.removeItem() SessionStorage.clear()

questions?