Update Nov 2016: looks like this doesn’t work anymore.
The easiest and one of the most powerful ways is using http://debug.phonegap.com (it uses Weinre in the background, if you care). You just
- pick a random string, say
r4nd0m, - inject
<script src="http://debug.phonegap.com/target/target-script-min.js#r4nd0m"></script>into yourindex.html - visit
http://debug.phonegap.com/client/#r4nd0mand you will instantly be debugging your mobile web app.
Things you can do (similar to Firebug or Web Inspector):
- Viewing and changing the DOM
- Editing CSS
- Console for live debugging and running Javascript remotely.
- Other stuff, like: storage, resources, timeline, profile, etc.