1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
# Running Blimp
See [build](build.md) for instructions on how to build Blimp.
## Running the client
There are both Android and Linux clients. The Android client is the shipping
client while the Linux client is used for development purposes.
### Android Client
Install the Blimp APK with the following:
```bash
./build/android/adb_install_apk.py $(PRODUCT_DIR)/apks/Blimp.apk
```
Set up any command line flags with:
```bash
./build/android/adb_blimp_command_line --your-flag-here
```
To have the client connect to a custom engine use the `--engine-ip`,
`--engine-port`, and `--engine-transport` flags. The possible valid
values for `--engine-transport` are 'tcp' and 'ssl'.
An example valid endpoint would be
`--engine-ip=127.0.0.1 --engine-port=1234 --engine-transport=tcp`.
SSL-encrypted connections take an additional flag
`--engine-cert-path` which specifies a path to a PEM-encoded certificate
file (e.g. `--engine-cert-path=/path/to/file.pem`.)
To see your current command line, run `adb_blimp_command_line` without any
arguments.
Run the Blimp APK with:
```bash
./build/android/adb_run_blimp_client
```
### Linux Client
The blimp client is built as part of the `blimp` target. To run it with local
logging enabled, execute:
```bash
./out-linux/Debug/blimp_shell \
--user-data-dir=/tmp/blimpclient \
--enable-logging=stderr \
--vmodule="*=1"
```
### Instructing client to connect to specific host
If you run the engine on your local host and you want the client to connect to
it instead of using the assigner, you need to instruct the client to use the
correct host and port to connect to by giving it the correct command line flag.
Typically this flag would be:
```bash
--blimplet-endpoint=tcp:127.0.0.1:25467
```
## Running the engine
### In a container
For running the engine in a container, see [container](container.md).
### On a workstation
To run the engine on a workstation and make your Android client connect to it,
you need to forward a port from the Android device to the host, and also
instruct the client to connect using that port on its localhost address.
#### Port forwarding
If you are running the engine on your workstation and are connected to the
client device via USB, you'll need remote port forwarding to allow the Blimp
client to talk to your computer.
##### Option A
Follow the
[remote debugging instructions](https://developer.chrome.com/devtools/docs/remote-debugging)
to get started. You'll probably want to remap 25467 to "localhost:25467".
*Note* This requires the separate `Chrome` application to be running on the
device. Otherwise you will not see the green light for the port forwarding.
##### Option B
If you are having issues with using the built-in Chrome port forwarding, you can
also start a new shell and keep the following command running:
```bash
./build/android/adb_reverse_forwarder.py --debug -v 25467 25467
```
### Required engine binary flags
* `--blimp-client-token-path=$PATH`: Path to a file containing a nonempty
token string. If this is not present, the engine will fail to boot.
* `--use-remote-compositing`: Ensures that the renderer uses the remote
compositor.
* `--disable-cached-picture-raster`: Ensures that rasterized content is not
destroyed before serialization.
* `--android-fonts-path=$PATH`: Path to where the fonts are located.
Typically this would be `out-linux/Debug/gen/third_party/blimp_fonts`.
#### Typical invocation
When the client connects to a manually specified engine instead of using the
assigner, it will use a dummy token. The engine needs to know what this token
is, so it must be provided using the `--blimp-client-token-path` flag. The token
is available in the constant `kDummyClientToken` in
`blimp/client/session/assignment_source.h`. You can easily store that to a file
by running the following command once:
```bash
awk '{if ( match($0, /^\s*const char kDummyClientToken.*/) ) { print substr($5, 2, length($5)-3);} }' \
./blimp/client/session/assignment_source.h > /tmp/blimpengine-token
```
Then start the engine using these flags:
```bash
out-linux/Debug/blimp_engine_app \
--use-remote-compositing \
--disable-cached-picture-raster \
--blimp-client-token-path=/tmp/blimpengine-token \
--user-data-dir=/tmp/blimpengine \
--android-fonts-path=out-linux/Debug/gen/third_party/blimp_fonts \
--enable-logging=stderr \
--vmodule="blimp*=1"
```
|