> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Trace (xbtrace.exe)

> Trace (xbtrace.exe)

Use this tool to start and stop detailed tracing on a console.

> [!NOTE]
>
> The xbtrace.exe command-line tool no longer supports capturing XBOX Services API (XSAPI) traffic. For Microsoft Game Development Kit (GDK) titles, use Fiddler to capture XBOX Live network calls. Then use the XBOX Live Trace Analyzer to analyze the Fiddler trace. For more information, see [Trace Analyzer for reviewing service calls](/tools/tools-services/live-trace-analyzer).

This tool provides the following subcommands and functions.

| Command | Description |
| - | - |
| [xbtrace start netcap](#xbtrace_start_netcap) | Starts a network trace capture |
| [xbtrace stop](#xbtrace_stop) | Stops and saves a trace |
| [xbtrace log](#xbtrace_log) | Collects a log during an event tracing session on the remote console |

## Starting a network trace capture

| Column 1 |
| - |
| \*\*xbtrace \*\**start* *tracetype* \[/X\[:]*address\[+\<accesskey>]*] |

| Option | Description |
| - | - |
| *start* | Starts a network trace capture. If a trace is already in progress, **xbtrace** displays a message to that effect and continues to capture the trace data. |
| *tracetype* | The type of a trace to be started. The following types of traces are available. **advancedmp** - Advanced multiplayer capture.  Use this type of trace to take advanced multiplayer traces that contain the information that's needed to debug issues in multiplayer sessions. Advanced multiplayer trace sessions automatically collect a network state log when **start** and **stop** are executed. When **stop** is called, all trace files and network state logs are copied to the development PC in a trace session directory. Additional network state logs can be collected during advanced multiplayer trace sessions by using the **log netstate** command. To capture the current state of a multiplayer session, use the following steps.   1. Use **xbTrace start advancedmp** to start a trace.   2. Use **log netstate** to take a snap of the current session at various points of interest.   3. Use **xbtrace stop** to stop the trace. **netcap** - Network packet capture. |
| /X\[:]*address\[+\<accesskey>]* | - Use this option to specify the host name or address (shown as **Tools IP** on the console) of a targeted console without changing the default console. For details about setting a host name for a console, see [Setting a host name for the console IP address](/home/setup-install/dev-kit-settings/setting-a-hostname). - If you don't use this option, the default console (previously set by [Connect (xbconnect.exe)](/tools/tools-console/commandlinetools/xbconnect)) is used. - Use the *accesskey* string to provide console access only to those people who have the access key. - Set the access key by using the command **xbconfig** **accesskey=your-key**, and then restart your console to make the access key effective. - To access a console that's configured with an access key, include a plus sign (+) and the access key after the IP address or host name of the console. - If an access key is provided when the default console is set by [xbconnect](/tools/tools-console/commandlinetools/xbconnect), the access key is stored as part of the default console's address. - For more information about access keys, see [xbconfig accesskey](/tools/tools-console/commandlinetools/xbconfig). |

## Stop and save a network trace capture

| Column 1 |
| - |
| **xbtrace** \[*stop* \[etlfile] ] \[/X\[:]*address\[+\<accesskey>]*] |

| Option | Description |
| - | - |
| *stop* \[etlfile] | Stops and saves the currently running network trace. **etlfile** is an optional file name (with an optional path) for the saved trace data. If you don't specify a file name, the captured data is saved in a file named xbtrace.etl in the current directory. If you specify a file name without a path, the file is saved under the specified name in the current directory. If the file you specify already exists, **xbtrace** displays a message to that effect and continues to capture the trace data. At this time, there's no option to force the file to be overwritten. |
| /X\[:]*address\[+\<accesskey>]* | - Use this option to specify the host name or address (shown as **Tools IP** on the console) of a targeted console without changing the default console. For details about setting a host name for a console, see [Setting a host name for the console IP address](/home/setup-install/dev-kit-settings/setting-a-hostname). - If you don't use this option, the default console (previously set by [Connect (xbconnect.exe)](/tools/tools-console/commandlinetools/xbconnect)) is used. - Use the *accesskey* string to provide console access only to those people who have the access key. - Set the access key by using the command **xbconfig** **accesskey=your-key**, and then restart your console to make the access key effective. - To access a console that's configured with an access key, include a plus sign (+) and the access key after the IP address or host name of the console. - If an access key is provided when the default console is set by [xbconnect](/tools/tools-console/commandlinetools/xbconnect), the access key is stored as part of the default console's address. - For more information about access keys, see [xbconfig accesskey](/tools/tools-console/commandlinetools/xbconfig). |

## Collect a log during an event tracing session on the remote console

| Column 1 |
| - |
| \*\*xbtrace \*\**log* *logtype* \[/X\[:]*address\[+\<accesskey>]*] |

| Option | Description |
| - | - |
| *log* | Collects a log during an event tracing session on the remote console. |
| *logtype* | The log type to be collected. The following log type is available. **netstate** - Network state The resulting trace files are placed on the development PC in a directory whose name includes "xbtrace" and a time stamp. |
| /X\[:]*address\[+\<accesskey>]* | - Use this option to specify the host name or address (shown as **Tools IP** on the console) of a targeted console without changing the default console. For details about setting a host name for a console, see [Setting a host name for the console IP address](/home/setup-install/dev-kit-settings/setting-a-hostname). - If you don't use this option, the default console (previously set by [Connect (xbconnect.exe)](/tools/tools-console/commandlinetools/xbconnect)) is used. - Use the *accesskey* string to provide console access only to those people who have the access key. - Set the access key by using the command **xbconfig** **accesskey=your-key**, and then restart your console to make the access key effective. - To access a console that's configured with an access key, include a plus sign (+) and the access key after the IP address or host name of the console. - If an access key is provided when the default console is set by [xbconnect](/tools/tools-console/commandlinetools/xbconnect), the access key is stored as part of the default console's address. - For more information about access keys, see [xbconfig accesskey](/tools/tools-console/commandlinetools/xbconfig). |

## Example

```
xbtrace start netcap
xbtrace start advancedmp
xbtrace stop
xbtrace stop c:\netcaptemp\netcap.etl
xbtrace stop c:\advancedmptemp
xbtrace log netstate  
```

## See also

[Command-line tools](/tools/tools-console/commandlinetools/commandlinetools)

[XTF transport errors](/tools/tools-console/commandlinetools/xtf-transport-errors)

[Connect (xbconnect.exe)](/tools/tools-console/commandlinetools/xbconnect)


## Related topics

- [XBOX Live page for Dev Home](/tools/tools-console/devhome/devhome-live.md)
- [Networking page](/tools/tools-console/devhome/devhome-networking.md)
- [Xbox One Network Capture](/build/console-features/networking/tools/netcap-networking.md)
- [Command-line tools for console development](/tools/tools-console/commandlinetools/commandlinetools.md)
- [Commandlinetools](/tools/tools-console/commandlinetools/index.md)
