# Development Toolchain<a name="EN-US_TOPIC_0000001089932323"></a>
## Introduction<a name="section11660541593"></a>
The development toolchain subsystem provides debugging commands and tools for performance monitoring and tracing.
This subsystem provides the following tools:
- bytrace: a tool for you to trace processes and monitor performance. It encapsulates and extends the ftrace inside the kernel and supports tracing in the user space.
- hdc: a command line tool for debugging. With hdc, you can interact with real devices or simulators from Windows, Linux, or macOS.
- profiler: a performance profiling platform for you to analyze memory and performance issues.
## Architecture<a name="section342962219551"></a>
The figure below shows the architecture of the development toolchain subsystem.
**Figure 1** Architecture of the development toolchain subsystem<aname="fig4460722185514"></a>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1896813132220"><aname="p1896813132220"></a><aname="p1896813132220"></a>Displays help information.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p139682017228"><aname="p139682017228"></a><aname="p139682017228"></a>Sets <emid="i496841112217"><aname="i496841112217"></a><aname="i496841112217"></a>n</em> KB of memory for storing trace logs. The default value is 2 MB.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1396913162213"><aname="p1396913162213"></a><aname="p1396913162213"></a>Sets the trace uptime, in seconds. The value varies depending on the time required for analysis.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p39696116229"><aname="p39696116229"></a><aname="p39696116229"></a>Sets the type of the clock for adding a timestamp to a trace. The value can be <strong>boot</strong> (default), <strong>global</strong>, <strong>mono</strong>, <strong>uptime</strong>, or <strong>perf</strong>.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p4969161122217"><aname="p4969161122217"></a><aname="p4969161122217"></a>Dumps traced data to a specified position (console by default).</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p69691614229"><aname="p69691614229"></a><aname="p69691614229"></a>Stops trace and outputs data to the specified position (console by default).</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p20969516221"><aname="p20969516221"></a><aname="p20969516221"></a>Lists the bytrace categories supported by the device.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p109693162215"><aname="p109693162215"></a><aname="p109693162215"></a>Overwrites the latest information when the buffer is full. By default, the earliest data is overwritten.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p697017110220"><aname="p697017110220"></a><aname="p697017110220"></a>Outputs traced data to a specified file.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p149704113226"><aname="p149704113226"></a><aname="p149704113226"></a>Compresses the traced data.</p>
</td>
</tr>
</tbody>
</table>
Examples:
- Query supported labels.
```
bytrace -l
Or
bytrace --list_categories
```
- Trace ability information for 10 seconds and store the traced data in a buffer of 4 MB.
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p29713110221"><aname="p29713110221"></a><aname="p29713110221"></a>Specifies the identifier of the device to connect.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1597101162218"><aname="p1597101162218"></a><aname="p1597101162218"></a>Specifies the listening socket.</p>
The <tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p697261142216"><aname="p697261142216"></a><aname="p697261142216"></a>Displays the hdc help and version information.</span></p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p11972151152217"><aname="p11972151152217"></a><aname="p11972151152217"></a>Displays all connected devices.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1197217117221"><aname="p1197217117221"></a><aname="p1197217117221"></a>Mounts the system partition in read/write mode.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p149721818223"><aname="p149721818223"></a><aname="p149721818223"></a>Restarts a target device. The system is started by default. The bootloader and recover modes are supported.</span></p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1397216111225"><aname="p1397216111225"></a><aname="p1397216111225"></a>Grants the <strong>root</strong> permission to the background hdc service. You can use the <strong>off</strong> option to revoke the granted permissions.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1497314112218"><aname="p1497314112218"></a><aname="p1497314112218"></a>Connects to the device with the specified IP address and port number.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p997319113226"><aname="p997319113226"></a><aname="p997319113226"></a><span>Restarts the daemon process of the device and connects to the device through USB preferentially.</p>
</td>
</tr>
<trid="row1697331192218"><tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.1 "><pid="p1973116220"><aname="p1973116220"></a><aname="p1973116220"></a>tmode port <emid="i159734192213"><aname="i159734192213"></a><aname="i159734192213"></a>port-number</em></p>
</td>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p197314122212"><aname="p197314122212"></a><aname="p197314122212"></a>Restarts the daemon process of the device and connects to the device over TCP preferentially. If the TCP connection fails, try a USB connection.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p169742111221"><aname="p169742111221"></a><aname="p169742111221"></a>Adds a port relay connection.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p159741142218"><aname="p159741142218"></a><aname="p159741142218"></a>Lists all relay connections.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p179742115221"><aname="p179742115221"></a><aname="p179742115221"></a>Deletes the relayed local connection. If no parameter is specified, all connections will be deleted.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1897531132216"><aname="p1897531132216"></a><aname="p1897531132216"></a>Sends a file to a remote device.</span></p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p189754172214"><aname="p189754172214"></a><aname="p189754172214"></a>Sends a file from a remote device to the local device.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p8975181132218"><aname="p8975181132218"></a><aname="p8975181132218"></a>Installs an OpenHarmony app.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1897681192216"><aname="p1897681192216"></a><aname="p1897681192216"></a>Installs all OpenHarmony apps in the specified directory.</p>
<tdclass="cellrowborder"valign="top"width="50%"headers="mcps1.2.3.1.2 "><pid="p1697710162213"><aname="p1697710162213"></a><aname="p1697710162213"></a>Runs a command remotely or enters the interactive command environment.</p>
</td>
</tr>
</tbody>
</table>
Examples:
- Send a file to a remote device.
```
hdc file send E:\c.txt /sdcard
```
- Restart a device.
```
hdc target boot
```
- Obtain log information.
```
hdc hilog
```
- Enter the interactive command mode:
```
hdc shell
```
- Set the listening socket.
```
hdc -s 192.168.1.100:1234
```
- Restart the device in bootloader mode.
```
hdc target boot bootloader
```
- Connect to the device with a specified IP address and port number.
```
hdc tconn 192.168.0.100:8710
```
### profiler
The profiler module consists of the system and application profiler frameworks. It provides a performance profiler platform for you to analyze system issues such as memory and performance.
This module provides capabilities respectively for the PC and for the device. The capabilities for the PC are released as a DevEco Studio plug-in, which contains the following sub-modules: UI drawing, device management, process management, plug-in management, data import, data storage, data analysis, session management, and configuration management. The capabilities for the device mainly contain the following sub-modules: the command line tool, service processes, plug-ins, and application components. The device-side profiler provides APIs for extending plug-ins. With these APIs, you can define your desired capabilities and integrate them into the framework. Currently, the real-time memory analysis and trace plug-ins are available. For details, see the profiler readme.