| OLD | NEW |
| 1 # Devtools | 1 # Devtools |
| 2 | 2 |
| 3 Unopinionated tools for **running**, **debugging** and **testing** Mojo apps. | 3 Unopinionated tools for **running**, **debugging** and **testing** Mojo apps. |
| 4 | 4 |
| 5 ## Install | 5 ## Install |
| 6 | 6 |
| 7 ``` | 7 ``` |
| 8 git clone https://github.com/domokit/devtools.git | 8 git clone https://github.com/domokit/devtools.git |
| 9 ``` | 9 ``` |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 ports used by `mojo_run`. | 22 ports used by `mojo_run`. |
| 23 | 23 |
| 24 ### Runner | 24 ### Runner |
| 25 | 25 |
| 26 `mojo_run` allows you to run a Mojo shell either on the host, or on an attached | 26 `mojo_run` allows you to run a Mojo shell either on the host, or on an attached |
| 27 Android device. | 27 Android device. |
| 28 | 28 |
| 29 ```sh | 29 ```sh |
| 30 mojo_run APP_URL # Run on the host. | 30 mojo_run APP_URL # Run on the host. |
| 31 mojo_run APP_URL --android # Run on Android device. | 31 mojo_run APP_URL --android # Run on Android device. |
| 32 mojo_run "APP_URL APP_ARGUMENTS" # Run an app with startup arguments |
| 32 ``` | 33 ``` |
| 33 | 34 |
| 34 Unless running within a Mojo checkout, we need to indicate the path to the shell | 35 Unless running within a Mojo checkout, we need to indicate the path to the shell |
| 35 binary: | 36 binary: |
| 36 | 37 |
| 37 ```sh | 38 ```sh |
| 38 mojo_run --shell-path path/to/shell/binary APP_URL | 39 mojo_run --shell-path path/to/shell/binary APP_URL |
| 39 ``` | 40 ``` |
| 40 | 41 |
| 42 Some applications are running embedded inside a window manager. To start such an |
| 43 app, you have to first start the window manager app, then have it embed the app |
| 44 you are interested in. It is done as follows using the default window manager: |
| 45 |
| 46 ```sh |
| 47 mojo_run "mojo:window_manager APP_URL" |
| 48 ``` |
| 49 |
| 50 By default, `mojo_run` uses `mojo:kiosk_wm` as the default window manager. It |
| 51 can be changed using the `--window-manager` flag. |
| 52 |
| 41 #### Sky apps | 53 #### Sky apps |
| 42 | 54 |
| 43 To run a [Sky](https://github.com/domokit/sky_engine) app, you need to build | 55 To run a [Sky](https://github.com/domokit/sky_engine) app, you need to build |
| 44 `sky_viewer.mojo` in a Sky checkout, and indicate the path to the binary using | 56 `sky_viewer.mojo` in a Sky checkout, and indicate the path to the binary using |
| 45 the `--map-url` parameter: | 57 the `--map-url` parameter: |
| 46 | 58 |
| 47 ```sh | 59 ```sh |
| 48 mojo_run --map-url mojo:sky_viewer=/path/to/sky/viewer APP_URL | 60 mojo_run --map-url mojo:sky_viewer=/path/to/sky/viewer "mojo:window_manager APP_
URL" |
| 49 ``` | 61 ``` |
| 50 | 62 |
| 51 If the app does not declare a shebang indicating that it needs to be run in | 63 If the app does not declare a shebang indicating that it needs to be run in |
| 52 `sky_viewer`, pass `--sky` to map `sky_viewer` as a default content handler for | 64 `sky_viewer`, pass `--sky` to map `sky_viewer` as a default content handler for |
| 53 dart apps: | 65 dart apps: |
| 54 | 66 |
| 55 ```sh | 67 ```sh |
| 56 mojo_run --map-url mojo:sky_viewer=/path/to/sky/viewer APP_URL --sky | 68 mojo_run --map-url mojo:sky_viewer=/path/to/sky/viewer "mojo:window_manager APP_
URL" --sky |
| 57 ``` | 69 ``` |
| 58 | 70 |
| 59 Note that Sky apps will need the --use-osmesa flag to run | 71 Note that Sky apps will need the --use-osmesa flag to run |
| 60 over [chromoting](https://support.google.com/chrome/answer/1649523?hl=en): | 72 over [chromoting](https://support.google.com/chrome/answer/1649523?hl=en): |
| 61 | 73 |
| 62 ### Debugger | 74 ### Debugger |
| 63 | 75 |
| 64 `mojo_debug` allows you to interactively inspect a running shell, collect | 76 `mojo_debug` allows you to interactively inspect a running shell, collect |
| 65 performance traces and attach a gdb debugger. | 77 performance traces and attach a gdb debugger. |
| 66 | 78 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 Linux and support for apptest frameworks. The executable scripts in devtools are | 135 Linux and support for apptest frameworks. The executable scripts in devtools are |
| 124 based on this module. One can also choose to embed the functionality provided by | 136 based on this module. One can also choose to embed the functionality provided by |
| 125 **devtoolslib** in their own wrapper. | 137 **devtoolslib** in their own wrapper. |
| 126 | 138 |
| 127 ## Development | 139 ## Development |
| 128 | 140 |
| 129 The library is canonically developed [in the mojo | 141 The library is canonically developed [in the mojo |
| 130 repository](https://github.com/domokit/mojo/tree/master/mojo/devtools/common), | 142 repository](https://github.com/domokit/mojo/tree/master/mojo/devtools/common), |
| 131 https://github.com/domokit/devtools is a mirror allowing to consume it | 143 https://github.com/domokit/devtools is a mirror allowing to consume it |
| 132 separately. | 144 separately. |
| OLD | NEW |