Working remotely with Android


If you want to work remotely from your laptop with an Android device attached to it, while keeping an ssh connection to a remote desktop machine where you have your build environment setup, you will have to use one of the two alternatives listed below.

Option 1: SSHFS - Mounting the out/Debug directory

On your laptop

You have to have an Android device attached to it.

# Install sshfs

laptop$ sudo apt-get install sshfs

# Mount the chrome source from your remote host machine into your local laptop.

laptop$ mkdir ~/chrome_sshfs
laptop$ sshfs ./chrome_sshfs

# Setup environment.

laptop$ cd chrome_sshfs
laptop$ third_party/android_tools/sdk/platform-tools/adb devices

# Run tests.

laptop$ out/Default/bin/run_$YOUR_TEST
This is assuming you have the exact same linux version on your host machine and in your laptop.

But if you have different versions, lets say, Ubuntu Lucid on your laptop, and the newer Ubuntu Precise on your host machine, some binaries compiled on the host will not work on your laptop. In this case you will have to recompile these binaries in your laptop:

# May need to install dependencies on your laptop.

laptop$ sudo ./build/

# Rebuild the needed binaries on your laptop.

laptop$ ninja -C out/Debug md5sum host_forwarder

Option 2: SSH Tunneling

Copy /tools/android/ to your laptop, then run it. updates itself, so you only need to copy it once.

laptop$ curl -sSf "" | base64 --decode >
laptop$ chmod +x
laptop$ ./ <desktop_hostname> <path_to_adb_on_desktop>

On your host machine

desktop$ out/Default/bin/run_$YOUR_TEST