Change what devices a UWP app targets

隐身守侯 提交于 2020-01-02 16:09:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!