Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Side by Side Diff: tools/android/adb_remote_setup.sh

Issue 120263003: Add a script for configuring adb for working remotely. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 #!/bin/bash
2
3 if [[ $# -ne 2 ]]; then
4 cat <<'EOF'
5 Usage: adb_remote_setup.sh REMOTE_HOST REMOTE_ADB
6
7 Configures adb on a remote machine to communicate with a device attached to the
8 local machine. This is useful for installing APKs, running tests, etc while
9 working remotely.
10
11 Arguments:
12 REMOTE_HOST hostname of remote machine
13 REMOTE_ADB path to adb on the remote machine
14 EOF
15 exit 1
16 fi
17
18 remote_host="$1"
19 remote_adb="$2"
20
21 if which kinit >/dev/null; then
22 # Allow ssh to succeed without typing your password multiple times.
23 kinit -R || kinit
24 fi
25
26 # Kill the adb server on the remote host.
27 ssh "$remote_host" "$remote_adb kill-server"
28
29 # Start the adb server locally.
30 adb start-server
31
32 # Forward various ports from the remote host to the local host:
33 # 5037: adb
34 # 8001: http server
35 # 9031: sync server
36 # 10000: net unittests
37 # 10201: net unittests
38 ssh -C \
39 -R 5037:localhost:5037 \
nyquist 2013/12/20 23:18:59 Could you read these ports out from build/android/
40 -L 8001:localhost:8001 \
41 -L 9031:localhost:9031 \
42 -R 10000:localhost:10000 \
43 -R 10201:localhost:10201 \
44 "$remote_host"
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698