| OLD | NEW |
| 1 # Running Blimp | 1 # Running Blimp |
| 2 [TOC] | 2 [TOC] |
| 3 | 3 |
| 4 See [build](build.md) for instructions on how to build Blimp. | 4 See [build](build.md) for instructions on how to build Blimp. |
| 5 | 5 |
| 6 ## Android Client | 6 ## Android Client |
| 7 | 7 |
| 8 ### Installing the client | 8 ### Installing the client |
| 9 | 9 |
| 10 Install the Blimp APK with the following: | 10 Install the Chrome Public APK with the following: |
| 11 | 11 |
| 12 ```bash | 12 ```bash |
| 13 ./build/android/adb_install_apk.py $(PRODUCT_DIR)/apks/Blimp.apk | 13 ./build/android/adb_install_apk.py $(PRODUCT_DIR)/apks/ChromePublic.apk |
| 14 ``` | 14 ``` |
| 15 | 15 |
| 16 This is equivalent to just running: | 16 This is mostly equivalent to just running: |
| 17 | 17 |
| 18 ```bash | 18 ```bash |
| 19 adb install $(PRODUCT_DIR)/apks/Blimp.apk | 19 adb install $(PRODUCT_DIR)/apks/ChromePublic.apk |
| 20 ``` | 20 ``` |
| 21 | 21 |
| 22 ### Setting up command line flags | 22 ### Setting up command line flags |
| 23 | 23 |
| 24 Set up any command line flags with: | 24 Set up any command line flags with: |
| 25 | 25 |
| 26 ```bash | 26 ```bash |
| 27 ./build/android/adb_blimp_command_line --your-flag-here | 27 ./build/android/adb_chrome_public_command_line --your-flag-here |
| 28 ``` | 28 ``` |
| 29 | 29 |
| 30 To see your current command line, run `adb_blimp_command_line` without any | 30 To see your current command line, run `adb_blimp_command_line` without any |
| 31 arguments. | 31 arguments. |
| 32 | 32 |
| 33 The Blimp client reads command line arguments from the file | 33 The Chrome APK blimp client reads command line arguments from the file |
| 34 `/data/local/blimp-command-line` and the above script reads/writes that file. | 34 `/data/local/chrome-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` | 35 Typical format of the file is `chrome --your-flag-here`. So one can use `adb` |
| 36 directly to create the file: | 36 directly to create the file: |
| 37 | 37 |
| 38 ```bash | 38 ```bash |
| 39 echo 'chrome --engine-ip=10.0.2.2 --engine-port=25467 --engine-transport=tcp' \ | 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' \ | 40 '--blimp-client-token-path=/data/data/org.chromium.chrome/blimp_client_token'
\ |
| 41 '--vmodule="*=1""' > /tmp/blimp-command-line | 41 '--vmodule="*=1""' > /tmp/chrome-command-line |
| 42 adb push /tmp/blimp-command-line /data/local/blimp-command-line | 42 adb push /tmp/chrome-command-line /data/local/chrome-command-line |
| 43 adb shell start chmod 0664 /data/local/blimp-command-line | 43 adb shell start chmod 0664 /data/local/chrome-command-line |
| 44 ``` | 44 ``` |
| 45 | 45 |
| 46 ### Forcefully enabling the blimp client |
| 47 |
| 48 Usually, the end user will have to manually enable blimp by using the Blimp |
| 49 panel in the application settings, but for developers it might be beneficial to |
| 50 skip this check by forcefully enabling the blimp client. |
| 51 |
| 52 You can do this by adding the command line flag: |
| 53 ``` |
| 54 --enable-blimp |
| 55 ``` |
| 56 |
| 57 *Note:* This still does not skip the authentication checks for the assigner. You |
| 58 will still have to either pass in the `--engine-ip=...` argument or sign in |
| 59 with a valid account. |
| 60 |
| 46 ### Instructing client to connect to specific host | 61 ### Instructing client to connect to specific host |
| 47 | 62 |
| 48 To have the client connect to a custom engine use the `--engine-ip`, | 63 To have the client connect to a custom engine use the `--engine-ip`, |
| 49 `--engine-port`, and `--engine-transport` flags. The possible valid | 64 `--engine-port`, and `--engine-transport` flags. The possible valid |
| 50 values for `--engine-transport` are 'tcp' and 'ssl'. | 65 values for `--engine-transport` are 'tcp' and 'ssl'. |
| 51 An example valid endpoint would be | 66 An example valid endpoint would be |
| 52 `--engine-ip=127.0.0.1 --engine-port=25467 --engine-transport=tcp`. | 67 `--engine-ip=127.0.0.1 --engine-port=25467 --engine-transport=tcp`. |
| 53 | 68 |
| 54 SSL-encrypted connections take an additional flag | 69 SSL-encrypted connections take an additional flag |
| 55 `--engine-cert-path` which specifies a path to a PEM-encoded certificate | 70 `--engine-cert-path` which specifies a path to a PEM-encoded certificate |
| 56 file (e.g. `--engine-cert-path=/path_on_device_to/file.pem`). Remember to also | 71 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. | 72 copy the file to the device when using this option. |
| 58 | 73 |
| 59 ### Requesting the complete page from the engine | 74 ### Requesting the complete page from the engine |
| 60 The engine sends partially rendered content to the client. To request the | 75 The engine sends partially rendered content to the client. To request the |
| 61 complete page from the engine, use the `--download-whole-document` flag on the | 76 complete page from the engine, use the `--download-whole-document` flag on the |
| 62 client. | 77 client. |
| 63 | 78 |
| 64 ### Specifying the client auth token file | 79 ### Specifying the client auth token file |
| 65 The client needs access to a file containing a client auth token. One should | 80 The client needs access to a file containing a client auth token. One should |
| 66 make sure this file is available by pushing it onto the device before running | 81 make sure this file is available by pushing it onto the device before running |
| 67 the client. One can do this by running the following command: | 82 the client. One can do this by running the following command: |
| 68 | 83 |
| 69 ```bash | 84 ```bash |
| 70 adb push /path/to/blimp_client_token \ | 85 adb push /path/to/blimp_client_token \ |
| 71 /data/data/org.chromium.blimp/blimp_client_token | 86 /data/data/org.chromium.chrome/blimp_client_token |
| 72 ``` | 87 ``` |
| 73 | 88 |
| 74 To have the client use the given client auth token file, use the | 89 To have the client use the given client auth token file, use the |
| 75 `--blimp-client-token-path` flag (e.g. | 90 `--blimp-client-token-path` flag (e.g. |
| 76 `--blimp-client-token-path=/data/data/org.chromium.blimp/blimp_client_token`) | 91 `--blimp-client-token-path=/data/data/org.chromium.chrome/blimp_client_token`) |
| 77 | 92 |
| 78 An example of a client token file is | 93 An example of a client token file is |
| 79 [test_client_token](https://code.google.com/p/chromium/codesearch#chromium/src/b
limp/test/data/test_client_token). | 94 [test_client_token](https://code.google.com/p/chromium/codesearch#chromium/src/b
limp/test/data/test_client_token). |
| 80 | 95 |
| 81 ### Start the Client | 96 ### Start the Client |
| 82 Run the Blimp APK with: | 97 Run the Chrome Public APK with: |
| 83 | 98 |
| 84 ```bash | 99 ```bash |
| 85 ./build/android/adb_run_blimp_client | 100 ./build/android/adb_run_chrome_public |
| 86 ``` | 101 ``` |
| 87 The script under the cover uses adb to start the application: | 102 The script under the cover uses adb to start the application: |
| 88 | 103 |
| 89 ```bash | 104 ```bash |
| 90 adb shell am start -a android.intent.action.VIEW -n org.chromium.blimp/org.chrom
ium.blimp.BlimpRendererActivity | 105 adb shell am start -a android.intent.action.VIEW -n org.chromium.chrome/com.goog
le.android.apps.chrome.Main |
| 91 ``` | 106 ``` |
| 92 | 107 |
| 93 ### Connecting to an Engine running on a workstation | 108 ### Connecting to an Engine running on a workstation |
| 94 To run the engine on a workstation and make your Android client connect to it, | 109 To run the engine on a workstation and make your Android client connect to it, |
| 95 you need to forward a port from the Android device to the host, and also | 110 you need to forward a port from the Android device to the host, and also |
| 96 instruct the client to connect using that port on its localhost address. | 111 instruct the client to connect using that port on its localhost address. |
| 97 | 112 |
| 98 #### Port forwarding | 113 #### Port forwarding |
| 99 If you are running the engine on your workstation and are connected to the | 114 If you are running the engine on your workstation and are connected to the |
| 100 client device via USB, you'll need remote port forwarding to allow the Blimp | 115 client device via USB, you'll need remote port forwarding to allow the Blimp |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 ```bash | 231 ```bash |
| 217 out-linux/Debug/bin/client_engine_integration load -p/--apk-path /path/to/ap
k | 232 out-linux/Debug/bin/client_engine_integration load -p/--apk-path /path/to/ap
k |
| 218 ``` | 233 ``` |
| 219 | 234 |
| 220 You are now ready to run tests or do development. | 235 You are now ready to run tests or do development. |
| 221 | 236 |
| 222 Instead of `{load}`, if want to manually install/launch the client can also
do | 237 Instead of `{load}`, if want to manually install/launch the client can also
do |
| 223 e.g. the incremental install: | 238 e.g. the incremental install: |
| 224 | 239 |
| 225 ```bash | 240 ```bash |
| 226 ninja -C out-android/Debug blimp && \ | 241 ninja -C out-android/Debug blimp chrome_public_apk_incremental && \ |
| 227 out-android/Debug/bin/install_blimp_apk_incremental | 242 out-android/Debug/bin/install_chrome_public_apk_incremental |
| 228 ``` | 243 ``` |
| 229 | 244 |
| 230 3. `{stop}` Stops the engine & the forwarder: | 245 3. `{stop}` Stops the engine & the forwarder: |
| 231 | 246 |
| 232 ```bash | 247 ```bash |
| 233 out-linux/Debug/bin/client_engine_integration stop | 248 out-linux/Debug/bin/client_engine_integration stop |
| 234 ``` | 249 ``` |
| 235 | 250 |
| 236 #### Option B | 251 #### Option B |
| 237 | 252 |
| 238 1. `{run}` Start and keep running engine & forwarder. | 253 1. `{run}` Start and keep running engine & forwarder. |
| 239 Script keeps running and auto-checking engine process. Is responsible for | 254 Script keeps running and auto-checking engine process. Is responsible for |
| 240 killing engine if keyboard interrupts or client gets killed. | 255 killing engine if keyboard interrupts or client gets killed. |
| 241 | 256 |
| 242 ```bash | 257 ```bash |
| 243 out-linux/Debug/bin/client_engine_integration run | 258 out-linux/Debug/bin/client_engine_integration run |
| 244 ``` | 259 ``` |
| 245 | 260 |
| 246 2. Same as step 2 in Option A. | 261 2. Same as step 2 in Option A. |
| 247 | 262 |
| 248 3. Engine should be auto-killed by keyboard stopping the `{run}` script or the
client | 263 3. Engine should be auto-killed by keyboard stopping the `{run}` script or the
client |
| 249 gets wiped out. `{stop}` works as well. | 264 gets wiped out. `{stop}` works as well. |
| OLD | NEW |