OLD | NEW |
1 # mojo_run | 1 # mojo_run |
2 | 2 |
3 `mojo_run` allows you to run a Mojo shell either on the host, or on an attached | 3 `mojo_run` allows you to run a Mojo shell either on the host, or on an attached |
4 Android device. | 4 Android device. |
5 | 5 |
6 ```sh | 6 ```sh |
7 mojo_run APP_URL # Run on the host. | 7 mojo_run APP_URL # Run on Linux host. |
8 mojo_run APP_URL --android # Run on Android device. | 8 mojo_run APP_URL --android # Run on Android device. |
9 mojo_run "APP_URL APP_ARGUMENTS" # Run an app with startup arguments | 9 mojo_run "APP_URL APP_ARGUMENTS" # Run an app with startup arguments |
10 ``` | 10 ``` |
11 | 11 |
12 Unless running within a Mojo checkout, we need to indicate the path to the shell | 12 ## mojo version |
13 binary: | 13 |
| 14 `mojo_run` will download mojo shell and configure it to use `mojo:` apps built |
| 15 at the corresponding version, if you pass the git commit sha of the |
| 16 https://github.com/domokit/mojo repository as `--mojo-version`: |
14 | 17 |
15 ```sh | 18 ```sh |
16 mojo_run --shell-path path/to/shell/binary APP_URL | 19 mojo_run APP_URL --mojo-version SOME_HASH |
17 ``` | 20 ``` |
18 | 21 |
| 22 If your project uses a pinned version of mojo, you can put the pinned hash in |
| 23 a `MOJO_VERSION` file in any ancestor directory of `mojo_run`. This will make |
| 24 `mojo_run` infer the parameter automatically. |
| 25 |
| 26 If you don't want to use prebuilt binaries at the given version, you can |
| 27 configure the shell binary and the origin to use manually: |
| 28 |
| 29 ```sh |
| 30 mojo_run APP_URL --shell-path path/to/shell/binary --origin ORIGIN_URL |
| 31 ``` |
| 32 |
| 33 ## Running applications in a view |
| 34 |
19 Some applications implement ViewProvider and are run embedded in a view. To run | 35 Some applications implement ViewProvider and are run embedded in a view. To run |
20 these, you can pass the app url using the `--embed` flag: | 36 these, you can pass the app url using the `--embed` flag: |
21 | 37 |
22 ```sh | 38 ```sh |
23 mojo_run --embed APP_URL [--android] | 39 mojo_run --embed APP_URL [--android] |
24 ``` | 40 ``` |
25 | 41 |
26 ## Running multiple instances simultaneously | 42 ## Running multiple instances simultaneously |
27 | 43 |
28 `mojo_run` sets up development servers on fixed ports to facilitate caching | 44 `mojo_run` sets up development servers on fixed ports to facilitate caching |
(...skipping 29 matching lines...) Expand all Loading... |
58 ```sh | 74 ```sh |
59 mojo_run APP_URL | 75 mojo_run APP_URL |
60 ``` | 76 ``` |
61 | 77 |
62 and the following in another: | 78 and the following in another: |
63 | 79 |
64 ```sh | 80 ```sh |
65 mkdir ~/another_home | 81 mkdir ~/another_home |
66 HOME=~/another_home mojo_run APP_URL --reuse-servers | 82 HOME=~/another_home mojo_run APP_URL --reuse-servers |
67 ``` | 83 ``` |
68 | |
69 ## Setting default mojo origin | |
70 | |
71 When run outside of the `domokit/mojo` repository, `mojo_run` needs `--origin` | |
72 parameter to indicate where binaries of the core mojo services come from. If a | |
73 `MOJO_VERSION` file is present among ancestors of `mojo_run` and `--origin` | |
74 parameter is not set, origin will point to Google Storage location storing | |
75 binaries of core mojo services built at the git revision indicated in | |
76 `MOJO_VERSION`. | |
OLD | NEW |