Aardwolf
========
Aardwolf is a remote JavaScript debugger for Android / iOS / Windows Phone 7 / BlackBerry OS 6+ and is written in JavaScript. It's available under the MIT license.
Home page: http://lexandera.com/aardwolf/
Currently it supports:
- breakpoints
- code evaluation at breakpoint
- break on next
- step/continue execution control
- stack listing
- exception reporting (also for exceptions thrown in async calls)
- JavaScript console remoting
- a server for communication between the mobile device and the UI
- a code rewriter which injects debug info into your existing source code
- a debug library which can break execution of your scripts, report execution progress, evaluate code, etc.
- a UI for setting breakpoints, stepping through code and seeing the current position within the script
- Node.js. Get it here: http://nodejs.org/#download
- An Android 2.x/iOS/WindowsPhone7 device or emulator (although running them from a Firefox/Chrome/Safari window will also work)
- Begin by installing node.js and Git
- Get the Aardwolf source code from GitHub:
git clone git://github.com/lexandera/Aardwolf.git
- Download the required libraries by running "npm link" in the checked-out directory
- Start the server by running "node app.js -h <ip-or-hostname-of-your-computer>"
- After the server starts up, open http://localhost:8000 in your desktop browser. The debugger UI should appear.
- Open http://ip-or-hostname-of-your-computer:8500/calc.html on your phone and wait for the page to load. The line "Mobile device connected." should appear in the UI's output pane.
- You're now debugging the "calculator" example script.
- Replace calc.html with calc-coffee.html in the final step when opening the example.
- When starting the server, add an additional parameter called -d or --file-dir, like this:
`node app.js -h <ip-or-hostname-of-your-computer> -d </path/to/www/root>`
- In your HTML page include the aardwolf.js debug library as the very first JS file and change the paths of included files to point to the files modified by Aardwolf:
<pre>
<script type="text/javascript" src="http://ip-or-hostname-of-your-computer:8500/aardwolf.js"> </script>
<script type="text/javascript" src="http://ip-or-hostname-of-your-computer:8500/some-script.js"> </script>
<script type="text/javascript" src="http://ip-or-hostname-of-your-computer:8500/some-other-script.js"> </script>
</pre>
- Reload the debugger UI first, then reload the page you just modified. The line "Mobile device connected." should appear in the UI's output pane.
- You should now be able to evaluate code remotely, set breakpoints, etc.
jscode += readFile('some-script.js');
jscode += readFile('some-other-script.js');
you would need to change it to something like this:
jscode += readFile('http://aardwolf-host:8500/aardwolf.js'); // Don't forget to include this!
jscode += readFile('http://aardwolf-host:8500/some-script.js');
jscode += readFile('http://aardwolf-host:8500/some-other-script.js');
In most languages, making the modification should be pretty straightforward. PHP's file_get_contents($url)
and Clojure's (slurp url)
will handle the change from local paths to URLs transparently. In Scala you can use io.Source.fromURL(url).mkString
, Ruby has the 'OpenURI' module and in NodeJS you should be able to read remote files using the 'request' module.
breakpoint tool