问题
I want to my Windows UWP app to target only specific devices e.g. desktop and mobile. How do I specify that my app should only target these devices? I have found nothing of interest in the Package.appxmanifest
file, and project.json
only specifies what SDK's the app should use.
回答1:
There are two ways you can do it.
1 . Right click Package.appxmanifest
, and click View code, you can find the following code in the Package.appxmanifest
.
<Dependencies>
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
</Dependencies>
You can modify the Name property to "Windows.Desktop" or "Windows.Mobile" to target a specific device type.
2 .When you submit you app in Windows Dev Center, you can specific you app are able to run which type of device. In Pricing and availability step, you can do it as follow:
I think you'd better choose the second way.
来源:https://stackoverflow.com/questions/31977266/change-what-devices-a-uwp-app-targets