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 |
11 ## Contents | 11 ## Contents |
12 | 12 |
13 Devtools offers the following tools: | 13 Devtools offers the following tools: |
14 | 14 |
15 - `mojo_shell` - universal shell runner | 15 - `mojo_run` - universal shell runner |
16 - `debugger` - supports interactive tracing and debugging of a running mojo | 16 - `mojo_debug` - supports interactive tracing and debugging of a running mojo |
17 shell | 17 shell |
18 - `remote_adb_setup` - configures adb on a remote machine to communicate with | 18 - `remote_adb_setup` - configures adb on a remote machine to communicate with |
19 a device attached to the local machine | 19 a device attached to the local machine |
20 | 20 |
21 and a Python scripting library designed for being embedded (`devtoolslib`). | 21 and a Python scripting library designed for being embedded (`devtoolslib`). |
22 | 22 |
23 ### debugger | 23 ### Debugger |
24 | 24 |
25 The `debugger` script allows you to interactively inspect a running shell, | 25 The `mojo_debug` script allows you to interactively inspect a running shell, |
26 collect performance traces and attach a gdb debugger. | 26 collect performance traces and attach a gdb debugger. |
27 | 27 |
28 #### Tracing | 28 #### Tracing |
29 To collect [performance | 29 To collect [performance |
30 traces](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) | 30 traces](https://www.chromium.org/developers/how-tos/trace-event-profiling-tool) |
31 and retrieve the result: | 31 and retrieve the result: |
32 | 32 |
33 ```sh | 33 ```sh |
34 debugger tracing start | 34 mojo_debug tracing start |
35 debugger tracing stop [result.json] | 35 mojo_debug tracing stop [result.json] |
36 ``` | 36 ``` |
37 | 37 |
38 The trace file can be then loaded using the trace viewer in Chrome available at | 38 The trace file can be then loaded using the trace viewer in Chrome available at |
39 `about://tracing`. | 39 `about://tracing`. |
40 | 40 |
41 #### GDB | 41 #### GDB |
42 It is possible to inspect a Mojo Shell process using GDB. The `debugger` script | 42 It is possible to inspect a Mojo Shell process using GDB. The `debugger` script |
43 can be used to launch GDB and attach it to a running shell process (android | 43 can be used to launch GDB and attach it to a running shell process (android |
44 only): | 44 only): |
45 | 45 |
46 ```sh | 46 ```sh |
47 debugger gdb attach | 47 mojo_debug gdb attach |
48 ``` | 48 ``` |
49 | 49 |
50 #### Android crash stacks | 50 #### Android crash stacks |
51 When Mojo shell crashes on Android ("Unfortunately, Mojo shell has stopped.") | 51 When Mojo shell crashes on Android ("Unfortunately, Mojo shell has stopped.") |
52 due to a crash in native code, `debugger` can be used to find and symbolize the | 52 due to a crash in native code, `debugger` can be used to find and symbolize the |
53 stack trace present in the device log: | 53 stack trace present in the device log: |
54 | 54 |
55 ```sh | 55 ```sh |
56 debugger device stack | 56 mojo_debug device stack |
57 ``` | 57 ``` |
58 | 58 |
59 ### devtoolslib | 59 ### devtoolslib |
60 | 60 |
61 **devtoolslib** is a Python module containing the core scripting functionality | 61 **devtoolslib** is a Python module containing the core scripting functionality |
62 for running Mojo apps: shell abstraction with implementations for Android and | 62 for running Mojo apps: shell abstraction with implementations for Android and |
63 Linux and support for apptest frameworks. The executable scripts in devtools are | 63 Linux and support for apptest frameworks. The executable scripts in devtools are |
64 based on this module. One can also choose to embed the functionality provided by | 64 based on this module. One can also choose to embed the functionality provided by |
65 **devtoolslib** in their own wrapper. | 65 **devtoolslib** in their own wrapper. |
66 | 66 |
67 ## Development | 67 ## Development |
68 | 68 |
69 The library is canonically developed [in the mojo | 69 The library is canonically developed [in the mojo |
70 repository](https://github.com/domokit/mojo/tree/master/mojo/devtools/common), | 70 repository](https://github.com/domokit/mojo/tree/master/mojo/devtools/common), |
71 https://github.com/domokit/devtools is a mirror allowing to consume it | 71 https://github.com/domokit/devtools is a mirror allowing to consume it |
72 separately. | 72 separately. |
OLD | NEW |