OLD | NEW |
1 # Working remotely with Android | 1 # Working remotely with Android |
2 | 2 |
3 [TOC] | 3 [TOC] |
4 | 4 |
5 | 5 |
6 ## Introduction | 6 ## Introduction |
7 | 7 |
8 When you call /build/android/run_tests.py or | 8 When you call /build/android/run_tests.py or |
9 /build/android/run_instrumentation_tests.py it assumes an android device | 9 /build/android/run_instrumentation_tests.py it assumes an Android device |
10 is attached to the local host. | 10 is attached to the local host. |
11 | 11 |
12 TODO: these scripts do not exist. | 12 TODO: these scripts do not exist. |
13 | 13 |
14 If you want to work remotely from your laptop with an android device attached to | 14 If you want to work remotely from your laptop with an Android device attached to |
15 it, while keeping an ssh connection to a remote desktop machine where you have | 15 it, while keeping an ssh connection to a remote desktop machine where you have |
16 your build environment setup, you will have to use one of the two alternatives | 16 your build environment setup, you will have to use one of the two alternatives |
17 listed below. | 17 listed below. |
18 | 18 |
19 ## Option 1: SSHFS - Mounting the out/Debug directory | 19 ## Option 1: SSHFS - Mounting the out/Debug directory |
20 | 20 |
21 ### On your remote host machine | 21 ### On your remote host machine |
22 | 22 |
23 You can open a regular ssh to your host. | 23 You can open a regular ssh to your host. |
24 | 24 |
25 # build it | 25 # build it |
26 desktop$ cd $SRC; | 26 desktop$ cd $SRC; |
27 desktop$ . build/android/envsetup.sh | 27 desktop$ . build/android/envsetup.sh |
28 desktop$ build/gyp_chromium -DOS=android | 28 desktop$ build/gyp_chromium -DOS=android |
29 desktop$ ninja -C out/Debug | 29 desktop$ ninja -C out/Debug |
30 | 30 |
31 See also | 31 See also |
32 [Android Build Instructions](https://www.chromium.org/developers/how-tos/android
-build-instructions). | 32 [Android Build Instructions](https://www.chromium.org/developers/how-tos/android
-build-instructions). |
33 | 33 |
34 ### On your laptop | 34 ### On your laptop |
35 | 35 |
36 You have to have an android device attached to it. | 36 You have to have an Android device attached to it. |
37 | 37 |
38 ```shell | 38 ```shell |
39 # Install sshfs | 39 # Install sshfs |
40 | 40 |
41 laptop$ sudo apt-get install sshfs | 41 laptop$ sudo apt-get install sshfs |
42 | 42 |
43 # Mount the chrome source from your remote host machine into your local laptop. | 43 # Mount the chrome source from your remote host machine into your local laptop. |
44 | 44 |
45 laptop$ mkdir ~/chrome_sshfs | 45 laptop$ mkdir ~/chrome_sshfs |
46 laptop$ sshfs your.host.machine:/usr/local/code/chrome/src ./chrome_sshfs | 46 laptop$ sshfs your.host.machine:/usr/local/code/chrome/src ./chrome_sshfs |
47 | 47 |
48 # Setup enviroment. | 48 # Setup environment. |
49 | 49 |
50 laptop$ cd chrome_sshfs | 50 laptop$ cd chrome_sshfs |
51 laptop$ . build/android/envsetup.sh | 51 laptop$ . build/android/envsetup.sh |
52 laptop$ adb devices | 52 laptop$ adb devices |
53 laptop$ adb root | 53 laptop$ adb root |
54 | 54 |
55 # Install APK (which was previously built in the host machine). | 55 # Install APK (which was previously built in the host machine). |
56 | 56 |
57 laptop$ python build/android/adb_install_apk.py --apk ContentShell.apk --apk_pac
kage org.chromium.content_shell | 57 laptop$ python build/android/adb_install_apk.py --apk ContentShell.apk --apk_pac
kage org.chromium.content_shell |
58 | 58 |
59 # Run tests. | 59 # Run tests. |
60 | 60 |
61 laptop$ python build/android/run_instrumentation_tests.py -I --test-apk ContentS
hellTest -vvv | 61 laptop$ python build/android/run_instrumentation_tests.py -I --test-apk ContentS
hellTest -vvv |
62 ``` | 62 ``` |
63 | 63 |
64 *** note | 64 *** note |
65 This is assuming you have the exact same linux version on your host machine and | 65 This is assuming you have the exact same linux version on your host machine and |
66 in your laptop. | 66 in your laptop. |
67 *** | 67 *** |
68 | 68 |
69 But if you have different versions, lets say, ubuntu lucid on your laptop, and t
he newer ubuntu precise on your host machine, some binaries compiled on the host
will not work on your laptop. | 69 But if you have different versions, lets say, Ubuntu Lucid on your laptop, and t
he newer Ubuntu Precise on your host machine, some binaries compiled on the host
will not work on your laptop. |
70 In this case you will have to recompile these binaries in your laptop: | 70 In this case you will have to recompile these binaries in your laptop: |
71 | 71 |
72 ```shell | 72 ```shell |
73 # May need to install dependencies on your laptop. | 73 # May need to install dependencies on your laptop. |
74 | 74 |
75 laptop$ sudo ./build/install-build-deps-android.sh | 75 laptop$ sudo ./build/install-build-deps-android.sh |
76 | 76 |
77 # Rebuild the needed binaries on your laptop. | 77 # Rebuild the needed binaries on your laptop. |
78 | 78 |
79 laptop$ build/gyp_chromium -DOS=android | 79 laptop$ build/gyp_chromium -DOS=android |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 112 |
113 ```shell | 113 ```shell |
114 laptop$ ssh -C -R 5037:localhost:5037 -R 10000:localhost:10000 -R 10201:localhos
t:10201 <desktop_host_name> | 114 laptop$ ssh -C -R 5037:localhost:5037 -R 10000:localhost:10000 -R 10201:localhos
t:10201 <desktop_host_name> |
115 ``` | 115 ``` |
116 | 116 |
117 #### On your host machine | 117 #### On your host machine |
118 | 118 |
119 ```shell | 119 ```shell |
120 desktop$ python build/android/run_instrumentation_tests.py -I --test-apk Content
ShellTest -vvv | 120 desktop$ python build/android/run_instrumentation_tests.py -I --test-apk Content
ShellTest -vvv |
121 ``` | 121 ``` |
OLD | NEW |