一个 XCode 项目,两个目标,两个应用程序 (iPhone/iPad),不是通用应用程序

发布于 2024-10-16 12:36:43 字数 644 浏览 6 评论 0原文

我们有一个 XCode 项目,首先将其构建为通用应用程序,然后在路上我们改变了主意,不再将这两个应用程序放在同一个二进制文件中,因此我们创建了两个目标。

  1. 第一个名为:AppName,适用于 iPhone:基础 SDK 为 4.2,部署目标为 3.1.3。目标设备是 iPhone。
  2. 第二个名为:AppNameHD,适用于 iPad:基础 SDK 为 3.2,目标设备为 iPad。

经过几周的时间,我们可以轻松地为每个平台进行构建,并能够在 iPad 和 iPhone 上部署。

现在我们已准备好提交到应用程序商店,我担心代码可能会被拒绝。我们现在想提交仅限 iPad 的应用程序,但我环顾四周,在 itunesconnect 网站上没有任何地方可以指定目标设备,并且该项目首先被构建为通用应用程序。我想知道他们如何确定在哪个设备上测试二进制文件。

有关架构的更多信息: 我们为这两个目标使用默认生成的 info.plist 文件。我们应该为每个目标都有一个单独的 info.plist 吗?两个 .plist 文件之间应该存在哪些差异。

这里附上我们正在使用的实际 info.plist 文件。

提前感谢您的帮助。在此处输入图像描述

We have an XCode project that was first build as an universal app, and then on the road we changed our mind on having the two app in the same binary, so we created two targets.

  1. The first one is called: AppName and is for iPhone: the base SDK is 4.2 and deployment target is 3.1.3. Targeted Device is iPhone.
  2. The second is called: AppNameHD and is for iPad: the base SDK is 3.2 and targeted device is iPad.

It's been a few weeks now we are easily building for each of those platform and able to deploy on the both iPad and iPhone.

Now we are ready to submit to the app store and i'm worried about potential rejection of the code. We want to submit the iPad only app for now, but i've looked around there is nowhere in the itunesconnect site i can specify the targeted device, and as the project was structured first to be an universal app. I'm wondering how they determine on which device to test the binary.

More informations about the architecture:
We are using the default generated info.plist file for both targets. Should we have a separate info.plist for each of the target? what differences should be present between the two .plist files.

Here is attached the actual info.plist file we are using.

Thanks for your help in advance.enter image description here

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

锦爱 2024-10-23 12:36:43

首先,没有理由只针对 ipad 目标的基础 SDK 应该是 3.2。事实上,由于 iOS 4.2 在 ipad 上运行,因此如果不将基本 SDK 更改为 4.2,将会限制您的客户群。您可以将目标操作系统设置为 iOS 3.2,以确保应用程序能够在 iOS 3.2 上运行。

在您的目标配置构建设置中,查找“目标设备系列”,这将说明目标是否是“ipad”、“iphone”或(对于通用应用程序)“iphone/ipad”。

我还将一个通用应用程序迁移到两个不同的目标——这并不有趣。您必须非常仔细地检查您的构建设置和 .plist 文件,以确保它们对于预期的目标设备来说是正确的,特别是检查:Base SDK、iOS 部署目标、目标设备系列和 Info.plist 文件

First of all, there's no reason why your base SDK for the ipad only target should be 3.2. In fact, since iOS 4.2 runs on ipad, you're going to limit your customer base by not changing the base SDK to 4.2. You can set your target OS to iOS 3.2 to make sure the app will run on iOS 3.2.

In your target configuration build settings, look for "targeted device family", that will say whether or not the target is "ipad", "iphone" or (for universal apps) "iphone/ipad".

I also migrated a universal app to two separate targets -- it was not fun. You have to very carefully check your build settings and your .plist files to make sure they're sane for their intended target device, especially check:Base SDK, iOS deployment target, targeted device family, and Info.plist file

天生の放荡 2024-10-23 12:36:43

我们应该为每个目标都有一个单独的 info.plist 吗?

  • 是的。

两个 .plist 文件之间应该存在哪些差异?

  • 捆绑标识符(例如,iPhone/iPod 的 com.example.app 和 iPad 的 com.example.app-hd
  • (可选)图标(对于 iPhone、iPhone @ 2x 和 iPad)
  • (可选) 启动图像(iPhone、iPhone @2x 和 iPad 不同)
  • (可选) 支持的界面方向(根据我的经验,iPad 至少有 2 个方向)

Should we have a separate info.plist for each of the target?

  • Yes.

What differences should be present between the two .plist files?

  • Bundle identifier (e.g., com.example.app for iPhone/iPod and com.example.app-hd for iPad)
  • (optional) icon (different for iPhone, iPhone @2x and iPad)
  • (optional) Launch image (different for iPhone, iPhone @2x and iPad)
  • (optional) Supported interface orientations (in my experience, at least 2 orientations for iPad)
禾厶谷欠 2024-10-23 12:36:43

Apple 使用您的 Info.plist 来确定 itunesconnect 中的目标。

看看你的屏幕截图,我认为你只需要确保你没有在 iPhone 目标中指定 NSMainNibFile~ipad 和 UISupportedInterfaceOrientations~ipad,反之亦然,对于 iPad 目标(即不包含 iPhone 特定条目)。顺便说一句,在 Xcode 中打开 Info.plist 可以为键提供更具描述性的名称,并且还提供允许值的下拉列表。

还要小心 UIRequiredDeviceCapability,即,作为一般规则,仅在绝对需要时才在 plist 中包含一个键。

Apple uses your Info.plist to determine the target(s) in itunesconnect.

Looking at your screenshot I think you just need to make sure you do not specify the NSMainNibFile~ipad an UISupportedInterfaceOrientations~ipad in the iPhone target and visa versa for the iPad target (i.e. do not include iPhone specific entries). BTW, opening the Info.plist in Xcode provides much more descriptive names for the keys and also provides a dropdown for the allowed values.

Also be careful with UIRequiredDeviceCapabilities i.e. as a general rule only include a key in your plist if it's absolutely needed.

和我恋爱吧 2024-10-23 12:36:43

要在 iPad 中使用 iPhone 应用程序,无法启动启动图像,
解决方案:

在常规设置中为启动图像选择“不使用资产目录”。
添加,

To use an IPhone app in iPad, launch image is not getting,
solution:

Select "Don't Use Assets Catalog" for launch images in General settings.
Add,

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文