title | description | ms.date | ms.topic | dev_langs | author | ms.author | manager | ms.subservice | ||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Debug UWP apps on remote machines |
Review how to use Visual Studio to run, debug, profile, and test a Universal Windows Platform (UWP) app remotely on another computer or device. |
10/05/2018 |
how-to |
|
mikejo5000 |
mikejo |
mijacobs |
debug-diagnostics |
You can use Visual Studio to run, debug, profile, and test a Universal Windows Platform (UWP) app on another computer or device. Running the UWP app on a remote machine is especially helpful when the Visual Studio computer does not support UWP-specific functionality like touch, geo-location, or physical orientation.
To debug a UWP app on a remote device from Visual Studio:
- The Visual Studio project must be configured for remote debugging.
- The remote machine and the Visual Studio computer must be connected over a network, or connected directly through a USB or Ethernet cable. Debugging over the internet is not supported.
- You must turn on developer mode on both the Visual Studio computer and the remote machine.
- Remote computers must be running the Remote Tools for Visual Studio.
- Some Windows 10 and later versions start and run the remote tools automatically. Otherwise, install and run the Remote Tools for Visual Studio.
- Windows Mobile 10 devices don't require or support the remote tools.
You use the project Properties to specify the remote device to connect to. The settings differ depending on the programming language.
Caution
By default, the property page sets Universal (Unencrypted Protocol) as the Authentication Type for Windows 10 and later remote connections. You may need to set No Authentication to connect to the remote debugger. Universal (Unencrypted Protocol) and No Authentication protocols have no network security, so data passed between the development and remote machines is vulnerable. Choose these authentication types only for trusted networks that you are sure are not at risk from malicious or hostile traffic.
If you choose Windows Authentication for the Authentication Type, you will need to sign in to the remote machine when debugging. The remote debugger must also be running under Windows Authentication mode, with the same user account as on the Visual Studio machine.
-
Select the C# or Visual Basic project in Visual Studio Solution Explorer and select the Properties icon, press Alt+Enter, or right-click and choose Properties.
-
Select the Debug tab.
-
Under Target device, select Remote Machine for a remote computer, or Device for a direct-connected Windows Mobile 10 device.
-
For a remote machine, enter the network name or IP address in the Remote machine field, or select Find to search for the device in the Remote Connections dialog box.
-
Select the C++ project in Visual Studio Solution Explorer and select the Properties icon, press Alt+Enter, or right-click and choose Properties.
-
Select the Debugging tab.
-
Under Debugger to launch, select Remote Machine for a remote computer, or Device for a direct-connected Windows Mobile 10 device.
-
For a remote machine, enter or select the network name or IP address in the Machine Name field, or drop down and select Locate to search for the device in the Remote Connections dialog box.
In the Remote Connections dialog box, you can search for a specific remote computer name or IP address, or auto-detect connections by selecting the rounded-arrow refresh icon. The dialog searches only devices on the local subnet that are currently running the remote debugger. Not all devices can be detected in the Remote Connections dialog box.
Tip
If you can't connect to a remote device by name, try using its IP address. To determine the IP address, on the remote device, enter ipconfig in a command window. The IP address appears as IPv4 Address.
For Visual Studio to debug apps on a remote computer, the remote computer must be running the Remote Tools for Visual Studio.
- Windows Mobile 10 devices do not require or support the remote tools.
- Windows 11 PCs, and Windows 10 PCs running Creator's Update (version 1703) and later, Windows 10 Xbox, IoT, and HoloLens devices install the remote tools automatically when you deploy the app.
- On pre-Creator's Update Windows 10 PCs, you must manually download, install, and be running the remote tools on the remote computer before you start debugging.
To download and install the remote tools:
[!INCLUDE remote-debugger-download]
[!INCLUDE remote-debugger-configuration]
Remote debugging works the same as local debugging.
-
On pre-Creator's Update versions of Windows 10, make sure the Remote Debugging Monitor (msvsmon.exe) is running on the remote device.
-
On the Visual Studio computer, make sure the correct debugging target (Remote Machine or Device) appears next to the green arrow on the toolbar.
-
Start debugging by selecting Debug > Start Debugging, pressing F5, or selecting the green arrow on the toolbar.
The project recompiles, then deploys and starts on the remote device. The debugger suspends execution at breakpoints, and you can step into, over, and out of code.
-
If necessary, select Debug > Stop Debugging or press Shift+F5 to stop debugging and close the remote app.