When you create a UWP application find the file called Package.appxmanifest open it with notepad, and by default under Dependencies you should see this:
Which is probably topically what you would want to, which is to have TargetDeviceFamily Name="Windows.Universal" which means that it targets all of the Windows 10 devices!
However in my case I just want to target the desktop app, thus I need to set TargetDeviceFamily Name to Windows.Desktop as follow:
And there you have it.
Targeting different platform type:
Here are the different Names that you can set TargetDeviceFamily, so that it only works on:
Msdn reference: https://msdn.microsoft.com/en-us/library/windows/apps/dn986903.aspx