What it is
The applications run on Windows, Mac OS X, and Linux, and should run on any platform that is simultaneously supported by the Android Debug Bridge (adb) and Python (in the non-GUI version). Currently, it is able to debug code on any devices running Android (2.1 or 2.2). The Android emulator is also supported, allowing you to debug your code without a physical device.
The Android SDK is necessary to run the application. In particular, the adb tool is required to be in your $PATH. To run the shell version, a Python environment is required.
When you launch RemoteJS (GUI version), it will try to detect all attached devices. If there is none, it will wait for the first to be connected and make it the target device. If there' more than one device attached, you'll be asked to select one.
After your target device is finally set, you can simply unplug it and the application will automatically detect the disconnection. Again, if there's only one device left, that will be chosen for you. If there are at least two, then you'll need to select one again, otherwise the console will wait for one to be attached indefinitely.
After all is set up, most of the times you want to debug a specific web page. In order to load an URL, enter it:
The page will start being loaded on the device and the message
Opening www.sencha.com will be shown on the console. Expressions starting with
ftp:// are automatically identified as URL's.
You can print values with the
> for (var x in document) console.log(x) bgColor alinkColor width ...
Multiple instructions are also supported:
> var a = [1,2,3]; console.log(a) 1,2,3
Sometimes you might get an error:
> console.log(documant.title) ReferenceError: Can't find variable: documant
To recover previously entered expressions, press
Arrow/Page Up and you will be able to browse the history.
Arrow/Page Down works in the usual opposite way, giving you the expressions entered after the current one. The history is stored when you quit the application, which means it will still be available when you start a new session.
The non-GUI version works in a very similar way. You can type
python remotejs.py -h to check the usage.
How it works
When the application is started, it automatically installs an Android package (apk called RemoteJS on your selected device. If a package already exists, it is uninstalled first. This ensures total compatibility with the remote console.
The thin system-level functionality is exported from the Qt space to the web view through a very simple API. All the logic is then implemented on the JS side, including the entire console window, turning the native nature of the application into hybrid.