xcode 如何限制我的应用程序仅适用于 iPhone,不包括 iPod touch?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10014664/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How can I restrict my app for iPhone's only, excluding iPod touch?
提问by Daniel
How can I restrict my app for iPhone's only, excluding iPod touch ?
如何限制我的应用程序仅适用于 iPhone,不包括 iPod touch?
I don't want my app available on iPod Touch, is there a property in the info.plist I can use to specify this or is this something I will encounter during the setup on itunesconnect ?
我不希望我的应用程序在 iPod Touch 上可用,info.plist 中是否有一个属性可以用来指定它,或者这是我在 itunesconnect 上的设置过程中会遇到的问题?
回答by Mark Granoff
You could add gpsas a required device capability simply to exclude devices without the GPS hardware, which would rule out iPod touches.
您可以将gps添加为必需的设备功能,以排除没有 GPS 硬件的设备,这将排除 iPod touch。
Edit:Actually, the correct way to do this is to include for the UIRequiredDeviceCapabilitiesentry (a dictionary), the telephonykey with a value of YES, meaning, only devices that support telephony can use the app.
编辑:实际上,正确的方法是为UIRequiredDeviceCapabilities条目(字典)包含值为YES的电话键,这意味着只有支持电话的设备才能使用该应用程序。
Also, check out the complete referenceof what keys are available for use with UIRequiredDeviceCapabilities.
此外,请查看可用于UIRequiredDeviceCapabilities 的键的完整参考。
回答by Buneme Kyakilika
The above solutions are not the way Apple has recommended it should be done one their website. There are two ways that I am currently aware of.
上述解决方案不是 Apple 推荐的方式,应该在他们的网站上完成。我目前知道有两种方法。
When creating, the project in the latest version of Xcode, it allows you to choose the device family. Don't select universal or ipod. Just select iPhone.
在最新版本的 Xcode 中创建项目时,它允许您选择设备系列。不要选择通用或ipod。只需选择 iPhone。
An alterntive is in the application's Build Settings change the Targeted Device Family to iPhone, instead of iPhone/iPad.
另一种方法是在应用程序的构建设置中将目标设备系列更改为 iPhone,而不是 iPhone/iPad。