在 Info.plist 中指定设备系列

问题描述:

有没有一种方法可以仅根据 Info.plist 中的键来指定设备系列,而无需更改构建设置?我已经阅读了 UIDeviceFamily 在构建时被自动添加到 Info.plist 的信息,并且文档说我不应该手动添加这个键.假设我不能使用 Xcode,但我可以编辑 Info.plist,有没有办法指定应用程序是否应该只在 iPhone(或 iPad)上运行?

Is there a way to specify the device family solely based on a key in Info.plist, without changing the build settings? I have read about UIDeviceFamily being added automatically to Info.plist at build time, and the documentation says that I should not add this key manually. Let's say I cannot use Xcode, but I can edit Info.plist, is there a way to specify if the app should be running only on iPhone (or iPad)?

谢谢,

查看 UIDeviceFamily 中的文档

check out the docs in UIDeviceFamily

UIDeviceFamily

如果只需要支持 ipad,请将 DeviceFamily 设置为 2.对于 iphone 设置为 1.对于 Universe 包括 1 和 2

if you need to only support ipad, set the DeviceFamily to 2. For iphone set to 1. For universe include both 1 and 2