Chromium Code Reviews| Index: tools/android/adb_remote_setup.sh |
| diff --git a/tools/android/adb_remote_setup.sh b/tools/android/adb_remote_setup.sh |
| new file mode 100755 |
| index 0000000000000000000000000000000000000000..c4ed7cd9e8f37d78a4aad00b8f990f73b2b3e9b7 |
| --- /dev/null |
| +++ b/tools/android/adb_remote_setup.sh |
| @@ -0,0 +1,44 @@ |
| +#!/bin/bash |
| + |
| +if [[ $# -ne 2 ]]; then |
| + cat <<'EOF' |
| +Usage: adb_remote_setup.sh REMOTE_HOST REMOTE_ADB |
| + |
| +Configures adb on a remote machine to communicate with a device attached to the |
| +local machine. This is useful for installing APKs, running tests, etc while |
| +working remotely. |
| + |
| +Arguments: |
| + REMOTE_HOST hostname of remote machine |
| + REMOTE_ADB path to adb on the remote machine |
| +EOF |
| + exit 1 |
| +fi |
| + |
| +remote_host="$1" |
| +remote_adb="$2" |
| + |
| +if which kinit >/dev/null; then |
| + # Allow ssh to succeed without typing your password multiple times. |
| + kinit -R || kinit |
| +fi |
| + |
| +# Kill the adb server on the remote host. |
| +ssh "$remote_host" "$remote_adb kill-server" |
| + |
| +# Start the adb server locally. |
| +adb start-server |
| + |
| +# Forward various ports from the remote host to the local host: |
| +# 5037: adb |
| +# 8001: http server |
| +# 9031: sync server |
| +# 10000: net unittests |
| +# 10201: net unittests |
| +ssh -C \ |
| + -R 5037:localhost:5037 \ |
|
nyquist
2013/12/20 23:18:59
Could you read these ports out from build/android/
|
| + -L 8001:localhost:8001 \ |
| + -L 9031:localhost:9031 \ |
| + -R 10000:localhost:10000 \ |
| + -R 10201:localhost:10201 \ |
| + "$remote_host" |