OLD | NEW |
---|---|
1 # Running Blimp | 1 # Running Blimp |
2 [TOC] | |
2 | 3 |
3 See [build](build.md) for instructions on how to build Blimp. | 4 See [build](build.md) for instructions on how to build Blimp. |
4 | 5 |
5 ## Running the client | 6 ## Android Client |
6 | 7 |
7 There are both Android and Linux clients. The Android client is the shipping | 8 ### Installing the client |
8 client while the Linux client is used for development purposes. | 9 |
10 Install the Blimp APK with the following: | |
11 | |
12 ```bash | |
13 ./build/android/adb_install_apk.py $(PRODUCT_DIR)/apks/Blimp.apk | |
14 ``` | |
15 | |
16 This is equivalent to just running: | |
17 | |
18 ```bash | |
19 adb install $(PRODUCT_DIR)/apks/Blimp.apk | |
20 ``` | |
21 | |
22 ### Setting up command line flags | |
23 | |
24 Set up any command line flags with: | |
25 | |
26 ```bash | |
27 ./build/android/adb_blimp_command_line --your-flag-here | |
28 ``` | |
29 | |
30 To see your current command line, run `adb_blimp_command_line` without any | |
31 arguments. | |
32 | |
33 The Blimp client reads command line arguments from the file | |
34 `/data/local/blimp-command-line` and the above script reads/writes that file. | |
35 Typical format of the file is `chrome --your-flag-here`. So one can use `adb` | |
36 directly to create the file: | |
37 | |
38 ```bash | |
39 echo 'chrome --engine-ip=10.0.2.2 --engine-port=25467 --engine-transport=tcp' \ | |
40 '--blimp-client-token-path=/data/data/org.chromium.blimp/blimp_client_token' \ | |
41 '--vmodule="*=1""' > /tmp/blimp-command-line | |
42 adb push /tmp/blimp-command-line /data/local/blimp-command-line | |
43 adb shell start chmod 0664 /data/local/blimp-command-line | |
44 ``` | |
9 | 45 |
10 ### Instructing client to connect to specific host | 46 ### Instructing client to connect to specific host |
11 | 47 |
12 To have the client connect to a custom engine use the `--engine-ip`, | 48 To have the client connect to a custom engine use the `--engine-ip`, |
13 `--engine-port`, and `--engine-transport` flags. The possible valid | 49 `--engine-port`, and `--engine-transport` flags. The possible valid |
14 values for `--engine-transport` are 'tcp' and 'ssl'. | 50 values for `--engine-transport` are 'tcp' and 'ssl'. |
15 An example valid endpoint would be | 51 An example valid endpoint would be |
16 `--engine-ip=127.0.0.1 --engine-port=1234 --engine-transport=tcp`. | 52 `--engine-ip=127.0.0.1 --engine-port=25467 --engine-transport=tcp`. |
17 | 53 |
18 SSL-encrypted connections take an additional flag | 54 SSL-encrypted connections take an additional flag |
19 `--engine-cert-path` which specifies a path to a PEM-encoded certificate | 55 `--engine-cert-path` which specifies a path to a PEM-encoded certificate |
20 file (e.g. `--engine-cert-path=/path/to/file.pem`.) | 56 file (e.g. `--engine-cert-path=/path_on_device_to/file.pem`). Remember to also |
57 copy the file to the device when using this option. | |
21 | 58 |
22 ### Requesting the complete page from the engine | 59 ### Requesting the complete page from the engine |
23 The engine sends partially rendered content to the client. To request the comple te | 60 The engine sends partially rendered content to the client. To request the |
24 page from the engine, use the `--download-whole-document` flag on the client. | 61 complete page from the engine, use the `--download-whole-document` flag on the c lient. |
25 | 62 |
26 ### Specifying the client auth token file | 63 ### Specifying the client auth token file |
27 The client needs access to a file containing a client auth token. One should | 64 The client needs access to a file containing a client auth token. One should |
28 make sure this file is available by pushing it onto the device before running | 65 make sure this file is available by pushing it onto the device before running |
29 the client. One can do this by running the following command: | 66 the client. One can do this by running the following command: |
30 | 67 |
31 ```bash | 68 ```bash |
32 adb push /path/to/blimp_client_token \ | 69 adb push /path/to/blimp_client_token \ |
33 /data/data/org.chromium.blimp/blimp_client_token | 70 /data/data/org.chromium.blimp/blimp_client_token |
34 ``` | 71 ``` |
35 | 72 |
36 To have the client use the given client auth token file, use the | 73 To have the client use the given client auth token file, use the |
37 `--blimp-client-token-path` flag (e.g. | 74 `--blimp-client-token-path` flag (e.g. |
38 `--blimp-client-token-path=/data/data/org.chromium.blimp/blimp_client_token`) | 75 `--blimp-client-token-path=/data/data/org.chromium.blimp/blimp_client_token`) |
39 | 76 |
40 An example of a client token file is | 77 An example of a client token file is |
41 [test_client_token](https://code.google.com/p/chromium/codesearch#chromium/src/b limp/test/data/test_client_token). | 78 [test_client_token](https://code.google.com/p/chromium/codesearch#chromium/src/b limp/test/data/test_client_token). |
42 | 79 |
43 ### Android Client | 80 ### Start the Client |
44 | |
45 Install the Blimp APK with the following: | |
46 | |
47 ```bash | |
48 ./build/android/adb_install_apk.py $(PRODUCT_DIR)/apks/Blimp.apk | |
49 ``` | |
50 | |
51 Set up any command line flags with: | |
52 | |
53 ```bash | |
54 ./build/android/adb_blimp_command_line --your-flag-here | |
55 ``` | |
56 | |
57 To see your current command line, run `adb_blimp_command_line` without any | |
58 arguments. | |
59 | |
60 Run the Blimp APK with: | 81 Run the Blimp APK with: |
61 | 82 |
62 ```bash | 83 ```bash |
63 ./build/android/adb_run_blimp_client | 84 ./build/android/adb_run_blimp_client |
64 ``` | 85 ``` |
65 | 86 The script under the cover uses adb to start the application: |
66 ### Linux Client | |
67 | |
68 The blimp client is built as part of the `blimp` target. To run it with local | |
69 logging enabled, execute: | |
70 | 87 |
71 ```bash | 88 ```bash |
72 ./out-linux/Debug/blimp_shell \ | 89 adb shell am start -a android.intent.action.VIEW -n org.chromium.blimp/org.chrom ium.blimp.BlimpRendererActivity |
73 --user-data-dir=/tmp/blimpclient \ | |
74 --enable-logging=stderr \ | |
75 --vmodule="*=1" | |
76 ``` | 90 ``` |
77 | 91 |
78 ## Running the engine | 92 ### Connecting to an Engine running on a workstation |
79 | |
80 ### In a container | |
81 For running the engine in a container, see [container](container.md). | |
82 | |
83 ### On a workstation | |
84 To run the engine on a workstation and make your Android client connect to it, | 93 To run the engine on a workstation and make your Android client connect to it, |
85 you need to forward a port from the Android device to the host, and also | 94 you need to forward a port from the Android device to the host, and also |
86 instruct the client to connect using that port on its localhost address. | 95 instruct the client to connect using that port on its localhost address. |
87 | 96 |
88 #### Port forwarding | 97 #### Port forwarding |
89 If you are running the engine on your workstation and are connected to the | 98 If you are running the engine on your workstation and are connected to the |
90 client device via USB, you'll need remote port forwarding to allow the Blimp | 99 client device via USB, you'll need remote port forwarding to allow the Blimp |
91 client to talk to your computer. | 100 client to talk to your computer. |
92 | 101 |
93 ##### Option A | 102 ##### Option A |
94 Follow the | 103 Follow the |
95 [remote debugging instructions](https://developer.chrome.com/devtools/docs/remot e-debugging) | 104 [remote debugging instructions](https://developer.chrome.com/devtools/docs/remot e-debugging) |
96 to get started. You'll probably want to remap 25467 to "localhost:25467". | 105 to get started. You'll probably want to remap 25467 to "localhost:25467". |
97 *Note* This requires the separate `Chrome` application to be running on the | 106 *Note* This requires the separate `Chrome` application to be running on the |
98 device. Otherwise you will not see the green light for the port forwarding. | 107 device. Otherwise you will not see the green light for the port forwarding. |
99 | 108 |
100 ##### Option B | 109 ##### Option B |
101 If you are having issues with using the built-in Chrome port forwarding, you can | 110 If you are having issues with using the built-in Chrome port forwarding, you can |
102 also start a new shell and keep the following command running: | 111 also start a new shell and keep the following command running: |
103 | 112 |
104 ```bash | 113 ```bash |
105 ./build/android/adb_reverse_forwarder.py --debug -v 25467 25467 | 114 ./build/android/adb_reverse_forwarder.py --debug -v 25467 25467 |
106 ``` | 115 ``` |
107 | 116 |
108 ### Required engine binary flags | 117 ### Running the client in an Android emulator |
118 Running the client using an Android emulator is similar to running it on device. | |
119 Here are a few gotchas: | |
120 | |
121 1. Build apk matching the emulator cpu type. Emulator cpu type is most likely | |
Kevin M
2016/06/28 22:31:53
an APK
The emulator
Sriram
2016/06/28 23:22:38
Done.
| |
122 x86 while the default Android build cpu type is ARM. Follow Android build | |
Kevin M
2016/06/28 22:31:53
x86, while
Kevin M
2016/06/28 22:31:53
Follow the
Sriram
2016/06/28 23:22:38
Done.
Sriram
2016/06/28 23:22:38
Done.
| |
123 instructions to change the CPU type. | |
124 | |
125 2. Ensure that the emulator is running at least Android Marshmallow so that | |
126 fonts are rendered correctly and also you have latest Play services binaries. | |
Kevin M
2016/06/28 22:31:53
Too long of a sentence- ". Also ensure that you ha
Sriram
2016/06/28 23:22:38
Done.
| |
127 | |
128 3. Some of scripts under `build/android` will fail to run as it uses `adb scp`. | |
Kevin M
2016/06/28 22:31:53
This detail seems like it should be more of an add
Sriram
2016/06/28 23:22:38
This is a gotcha list and not steps and I am incli
| |
129 Follow the instruction above to use `adb` directly. | |
130 | |
131 4. To connect to an Engine running on the host machine, you would have to use | |
Kevin M
2016/06/28 22:31:53
would have to => should
Sriram
2016/06/28 23:22:38
Done.
| |
132 `10.0.2.2` as `engine-ip` instead of `127.0.0.1` as `127.0.0.1` will refer to | |
133 the emulator itself. There is no need of setting up | |
Kevin M
2016/06/28 22:31:53
no need to set up
Sriram
2016/06/28 23:22:38
Done.
| |
134 [port forwarding](#Port-forwarding) when this approach is used. | |
135 | |
136 ## Linux Client | |
137 | |
138 The Linux client is used for development purpose while the Android client is | |
139 shipped. The Linux client is built as part of the `blimp` target. | |
140 To run it with local logging enabled, execute: | |
141 | |
142 ```bash | |
143 ./out-linux/Debug/blimp_shell \ | |
144 --user-data-dir=/tmp/blimpclient \ | |
145 --enable-logging=stderr \ | |
146 --vmodule="*=1" | |
147 ``` | |
148 | |
149 ## Running the engine | |
150 | |
151 ### In a container | |
152 For running the engine in a container, see [container](container.md). | |
153 | |
154 ### On a workstation | |
155 The following flags are required to start an Engine instance: | |
156 | |
109 * `--blimp-client-token-path=$PATH`: Path to a file containing a nonempty | 157 * `--blimp-client-token-path=$PATH`: Path to a file containing a nonempty |
110 token string. If this is not present, the engine will fail to boot. | 158 token string. If this is not present, the engine will fail to boot. |
111 * `--use-remote-compositing`: Ensures that the renderer uses the remote | 159 * `--use-remote-compositing`: Ensures that the renderer uses the remote |
112 compositor. | 160 compositor. |
113 * `--disable-cached-picture-raster`: Ensures that rasterized content is not | 161 * `--disable-cached-picture-raster`: Ensures that rasterized content is not |
114 destroyed before serialization. | 162 destroyed before serialization. |
115 * `--android-fonts-path=$PATH`: Path to where the fonts are located. | 163 * `--android-fonts-path=$PATH`: Path to where the fonts are located. |
116 Typically this would be `out-linux/Debug/gen/third_party/blimp_fonts`. | 164 Typically this would be `out-linux/Debug/gen/third_party/blimp_fonts`. |
117 * `--disable-remote-fonts`: Disables downloading of custom web fonts in the | 165 * `--disable-remote-fonts`: Disables downloading of custom web fonts in the |
118 renderer. | 166 renderer. |
119 | 167 |
120 #### Typical invocation | 168 #### Typical invocation |
121 | 169 |
122 One can start the engine using these flags: | 170 One can start the engine using these flags: |
123 | 171 |
124 ```bash | 172 ```bash |
125 out-linux/Debug/blimp_engine_app \ | 173 out-linux/Debug/blimp_engine_app \ |
126 --android-fonts-path=out-linux/Debug/gen/third_party/blimp_fonts \ | 174 --android-fonts-path=out-linux/Debug/gen/third_party/blimp_fonts \ |
127 --blimp-client-token-path=/tmp/blimpengine-token \ | 175 --blimp-client-token-path=/tmp/blimpengine-token \ |
128 --enable-logging=stderr \ | 176 --enable-logging=stderr \ |
129 --vmodule="blimp*=1" | 177 --vmodule="blimp*=1" |
130 ``` | 178 ``` |
OLD | NEW |