Xcode:如何将应用程序设置为仅限 iPhone?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/10767346/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 00:25:04  来源:igfitidea点击:

Xcode : How To Set App To Be iPhone Only?

iosiphoneobjective-cxcodecocos2d-iphone

提问by Guru

We have set the following app settings to be iPhone only, but in the App Store the app is listed as iPhone/iPad compatible.

我们已将以下应用程序设置设置为仅限 iPhone,但在 App Store 中,该应用程序被列为与 iPhone/iPad 兼容。

As you can see in the following image, the device family is set to be just iPhones:

如下图所示,设备系列设置为仅 iPhone:

enter image description here

在此处输入图片说明

Here is App: http://itunes.apple.com/us/app/carrom-pro/id525961441?mt=8.

这是应用程序:http: //itunes.apple.com/us/app/carrom-pro/id525961441?mt=8

Is there anything wrong with these settings?

这些设置有什么问题吗?

回答by Nikhil Jindal

Setting the deployment Devices to "Iphone" wont restrict it to iphone only.

将部署设备设置为“Iphone”不会仅限于 iphone。

The only way to do it is to add some Required Device capabilitieswhich iPad doesn't have. e.g., If you add telephonyor smsto the Required Device capabilitiesin Info.plist of the app, apple will automatically make the app available only for iPhone.

唯一的方法是添加一些iPad 没有的必需设备功能。例如,如果您在应用程序的 Info.plist 中的所需设备功能中添加电话短信,Apple 将自动使该应用程序仅适用于 iPhone。

For more device capabilities, refer to https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html

更多设备功能请参考https://developer.apple.com/library/ios/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html

I hope it helps.

我希望它有帮助。

回答by Evan Mulawski

All iPhone applications can be run on the iPad as well, just not "fullscreen" (see image below). Applications can be designed for iPhone and iPad separately, or a universal app, which contains the resources for both iPhone and iPad (interfaces, device handling, etc.).

所有 iPhone 应用程序也可以在 iPad 上运行,只是不能“全屏”(见下图)。可以分别为 iPhone 和 iPad 设计应用程序,也可以为包含 iPhone 和 iPad 资源(界面、设备处理等)的通用应用程序设计。

enter image description here

在此处输入图片说明

The user will notice a gray container around an application that is designed for iPhone. Universal apps will automatically choose the correct interface for the device.

用户会注意到专为 iPhone 设计的应用程序周围有一个灰色容器。通用应用程序将自动为设备选择正确的界面。

In the iTunes Store, applications with a blue plus symbol beside the price are Universal applications:

在 iTunes Store 中,价格旁边带有蓝色加号的应用程序是通用应用程序:

enter image description here

在此处输入图片说明

回答by prodeveloper

Keep UIDeviceFamilyproperty to 1(for iPhone) in app plist file and also change the Targeted Device Familyin Build settingsto 1(for iPhone). Keep 2in the both cases if you want to support iPad only. These are tested in XCode 8.

保持UIDeviceFamily属性为1(适用于iPhone)的应用plist文件,改变它的目标设备的家庭生成设置1(为iPhone)。如果您只想支持 iPad,请在这两种情况下都保留2。这些在 XCode 8 中进行了测试。

回答by CReaTuS

All iphone games can run in iPad. Therefore iTunes is writing iPhone/iPad. For search a iPad only games, user will search in iPad tab in iTunes where no any iPhone games, therefore don't worry about this. Universal device and iPhone only settings for iTunes detecting a apps for sort. And on some case for developers.

所有 iphone 游戏都可以在 iPad 上运行。因此 iTunes 正在编写 iPhone/iPad。对于只搜索 iPad 的游戏,用户将在 iTunes 中的 iPad 选项卡中搜索没有任何 iPhone 游戏的地方,因此不必担心这一点。用于 iTunes 检测应用程序以进行排序的通用设备和仅限 iPhone 的设置。在某些情况下,对于开发人员。