> ## 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.

# Connect (xbconnect.exe)

> Connect (xbconnect.exe)

Use this tool to set or query the default console's address that's used by Microsoft Game Development Kit (GDK) remote tools.

| Column 1 |
| - |
| **xbconnect** \[/B] \[/S] \[/T] \[/N] \[/D] \[/Q] \[/QG] \[/WS\[:sec] ] \[/WTP\[:sec] ] \[/WT\[:sec] ] \[/WTO\[:sec] ] \[/discover \[search string] ] \[/data] \[/?] \[*address\[+\<accesskey>] \[name]*] |

| Option | Description |
| - | - |
| /B | Shows only the name or address of the console and uses bare format. |
| /S | Shows only the System name or address and uses bare format. |
| /T | Shows only the name or address of the tool and uses bare format. |
| /N | Doesn't attempt to connect to the target address. |
| /D | Shows the registered extensions and the process build information. |
| /DX | Runs diagnostic tests to evaluate the connection health between the PC and XBOX Development Kit. For more information, see the Details about Connect diagnostic tests section later in this topic. |
| /Q | Performs only querying and doesn't register a default address, even if an address is provided. It's typically used with **/D** for direct querying without affecting the default console setting. |
| /QG | Queries whether the Title OS (Game OS) is running. Performs only querying and doesn't register a default address, even if an address is provided. **/QG** is typically used by scripts to determine the state of the Title OS for choosing the correct method for accessing the files of the title. In the scripts, ERRORLEVEL is set to 0 if the title is running. Otherwise, it's set to 1. See the **Checking the state of the Title OS in a script** section for an example showing checking the state of the Title OS in a script. |
| /WS\[:sec] |  • Causes **xbconnect** to block until the System OS is ready for interaction or the time-out is reached. • The default time-out is 120 seconds. There's an option to specify a custom value, such as **xbconnect /WS:200**. •  Returns ERRORLEVEL=0 if the console is ready or ERRORLEVEL=1 if the time-out is reached. •  Gives a reliable way of determining when a console is ready to receive commands, such as when you can call **xbapp launch** after **xbreboot**. •  To wait indefinitely, use -1 or "infinite". |
| /WTP\[:sec] |  • Causes **xbconnect** to block until Title process is ready for interaction. Default timeout is 300 seconds and can be configured by providing an approximate optional timeout value in seconds(ex: /WTP:200). Use a value of -1 or 'infinite' to wait indefinitely. |
| /WT\[:sec] |  • Causes **xbconnect** to block until the Game OS is ready for interaction or the time-out is reached. • The default time-out is 120 seconds. There's an option to specify a custom value, such as **xbconnect /WT:200**. •  Returns ERRORLEVEL=0 if the console is ready or ERRORLEVEL=1 if the time-out is reached. •  Gives a reliable way of determining when the Game OS has completed initialization and the game has started. •  To wait indefinitely, use -1 or "infinite". |
| /WTO\[:sec] |  • Causes **xbconnect** to block until Title OS is ready for interaction. Default timeout is 300 seconds and can be configured by providing an approximate optional timeout value in seconds(ex: /WTO:200). Use a value of -1 or 'infinite' to wait indefinitely. |
| /discover \[search string] | Searches the LAN for XBOX consoles, filtered by an optional substring. The search string applies to the consoles' host names, not their IP addresses. |
| /data | Returns the development PC-to-console connection speed in MBps. |
| /? | Shows a complete list of available options. |
| *address\[+\<accesskey>] \[name]* | *address\[+\<accesskey>]* specifies the host name or address (**Tools IP**) of a targeted console. • Setting the address changes the default console unless the **/Q** switch is specified. • If no address is specified, **xbconnect** shows the currently stored default address. • For details about setting a host name on a console, see [Setting a host name for the console IP address](/home/setup-install/dev-kit-settings/setting-a-hostname). 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 with **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). Use *name* to specify the name to be associated with the address. If no name is specified, **xbconnect** uses "devkit" as the console identifier. The *address* that development tools should use to connect to a console appears as **Console IP** on the console. •  If *address* isn't specified and a default address hasn't been set, **xbconnect** shows an error message. •  If *address* isn't specified and a default address has been set, **xbconnect** attempts to connect to the default console's address. This can be used to verify that the default console is still accessible. •  When invoking other remote tools, you can override the default console's address by using the **/X** switch to specify a dev kit. |
| /LC | Specify the locale code. Used to override the default locale code |

## Checking the state of the Title OS in a script

```
@xbconnect /QG > nul
@if ERRORLEVEL=1 GOTO SYSTEM

@echo Title running
@echo using xbcp
@GOTO ENDD

@:SYSTEM
@echo Title not running
@echo using robocopy 
@GOTO ENDD

@:ENDD
@echo Done
```

Running the script produces the following output.

```
C:\Scratch\D\GXDK\SigninUser\temp>testqg.bat
Title not running
using robocopy
Done
C:\Scratch\D\GXDK\SigninUser\temp>testqg.bat
Title running
using xbcp
Done  
```

## Details about Connect diagnostic tests

**xbconnect /dx** (diagnostics) runs a variety of tests, both locally on the development PC and on the development console, to determine what might be causing connection issues. These tests are separated into four groups, with categories of tests run in each group. Failures are displayed in red along with an error code and some text that describes the error code in more detail. In addition, some tests display more data that might be useful for troubleshooting.

### Local PC tests

Local PC tests run on your development PC and are independent of the development console.
Process running: test for processes that should be running to enable working with an XBOX development console. The processes tested include the following:

* XbtpLinkSvc.exe
* XrfsSvc.exe
  > [!NOTE]
  >
  > This specific process might not be started, and this isn't necessarily a true failure.

### PC to console tests

PC to console tests originate on the development PC and try to connect to the development console in various ways.

* **XbtpLink:** Tests that the XBTP protocol is working between the PC and console, either via Transmission Control Protocol (TCP) or by using an XBOX Transfer Device (XTD).
* **Query IP:** Asks the console to return its known IP addresses.
* **Ping:** Attempts to ping the target console on the IP address that's provided by using standard Internet Control Message Protocol (ICMP).
* **Port connections:** Attempts to connect to an open port that's running a service on the development console. These services and ports include the following:
  * XTF (XBOX Tools Framework): Port 4201/4211/4221
  * VS Debugger (Visual Studio Remote Debugger): Ports 4024/4022/4020/4016
  * Video Server (remote video server that's used by XBOX Manager): Port 11442
  * WDP (Windows Device Portal for XBOX): Port 11443

### Console tests

Console tests run on the remote console and are independent of the development PC.

* **Debug NIC:** Determines if the debug network port on the console is being used in addition to the retail network port.
* **Process running:** Tests for processes that should be running on the development console. These processes include Xtfhost.exe.

### Console to PC tests

Console to PC tests originate on the development console and try to connect to the development PC in various ways.

* **Ping:** Attempts to ping the target development PC by using the IP addresses that are provided by the PC.
  > [!NOTE]
  >
  > Every routable address on the PC is attempted, but not all addresses would be routable from the XBOX development console. Failures of specific addresses of this test aren't uncommon.
* **XbtpLink:** Tests that the XBTP protocol is working between the development PC and development console, either via TCP or by using an XTD.

### Diagnostic output example

An example of diagnostic output is shown in the following screenshot.

![Screenshot of xbconnect diagnostics](https://mintcdn.com/microsoft-4404708b/0AcfaOdKrAaDPaQZ/images/gdk/tools/xbconnect_diagnostics.webp?fit=max\&auto=format\&n=0AcfaOdKrAaDPaQZ\&q=85\&s=fb112edebb182f6653147f82914d91f7)

## See also

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

[File copy (xbcp.exe)](/tools/tools-console/commandlinetools/xbcp)

[Directory (xbdir.exe)](/tools/tools-console/commandlinetools/xbdir)

[Diagnostics information (xbdiaginfo.exe)](/tools/tools-console/commandlinetools/xbdiaginfo)


## Related topics

- [Provision (xbprovision.exe)](/tools/tools-console/commandlinetools/xbprovision.md)
- [Reboot (xbreboot.exe)](/tools/tools-console/commandlinetools/xbreboot.md)
- [Credentials (xbcred.exe)](/tools/tools-console/commandlinetools/xbcred.md)
- [Directory (xbdir.exe)](/tools/tools-console/commandlinetools/xbdir.md)
- [Trace (xbtrace.exe)](/tools/tools-console/commandlinetools/xbtrace.md)
