Debug an installed UWP app package in Visual Studio
Visual Studio can debug installed Universal Windows Platform (UWP) app packages on Windows 10 and newer computers and Xbox, HoloLens, and IoT devices.
Note
Visual Studio debugging for installed UWP apps is not supported on phones.
For more information about debugging UWP apps, see the blog posts on debugging installed app packages and building Universal Windows Apps (UWP).
Debug an installed UWP app on a local machine
In Visual Studio, select Debug > Other Debug Targets > Debug Installed App Package.
In the Debug Installed App Package dialog, under Connection Type, select Local Machine.
Under Installed App Packages, select the app you want to debug, or type its name in the search box. Non-running installed app packages appear under Not running, and running apps are under Running.
If necessary, change the code type under Debug this code type, and select other options.
- Select Do not launch, but debug my code when it starts to start debugging when the app starts. Starting debugging when the app launches is an effective way to debug control paths from different launch methods, such as protocol activation with custom parameters.
Select Start, or if the app is running, select Attach.
Note
You can also attach to any running UWP or other app process by selecting Debug > Attach to Process in Visual Studio. You don't need the original Visual Studio project to attach to a running process, but loading the app's symbols will help significantly when debugging a process that you don't have the original code for. See Specify symbol and source files in the debugger.
Debug an installed UWP app on a remote computer or device
The first time Visual Studio debugs an installed UWP app on a Windows 10 or newer device or a remote post-Creator's Update Windows 10 computer, it installs the remote debugging tools on the target device.
Enable developer mode on the Visual Studio computer and the remote device or computer.
If you are connecting to a remote computer running pre-Creator's Update Windows 10, manually install and start the remote debugger on the remote computer.
On the Visual Studio computer, select Debug > Other Debug Targets > Debug Installed App Package.
In the Debug Installed App Package dialog, under Connection Type, select Remote Machine or Device.
If you select Device, your computer must be physically connected to a Windows 10 or newer device.
For a remote machine, if the computer address doesn't appear next to Address, select Change.
In the Remote Connection dialog box, next to Address, type the name or IP address of the computer you want to connect to.
If the debugger can't connect to a remote computer using the computer name, use the IP address instead. Use the IP address for Xbox, HoloLens, or IoT devices.
Select an authentication option next to Authentication Mode.
For most apps, keep the default value, Universal (Unencrypted Protocol).
Select Select.
Under Installed App Packages, select the app you want to debug, or type its name in the search box. Non-running installed app packages appear under Not running, and running apps are under Running.
If necessary, change the code type under Debug this code type, and select other options.
- Select Do not launch, but debug my code when it starts to start debugging when the app starts. Starting debugging when the app launches is an effective way to debug control paths from different launch methods, such as protocol activation with custom parameters.
Select Start, or if the app is running, select Attach.
When you start debugging an installed app package on a connected Xbox, HoloLens, or IoT device for the first time, Visual Studio installs the correct version of the remote debugger for your target device. Installing the remote debugger might take some time, and the message Starting remote debugger displays while it is happening.
Note
Currently, Xbox or HoloLens devices restart the app with the debugger attached if it was already running.
For more information on remote deployment of UWP apps, see Deploy and debug UWP apps and Debug UWP apps on remote machines.