iOS Ad-Hoc OTA 分发适用于 iOS 6,但在 iOS 5 中失败 [英] iOS Ad-Hoc OTA distribution works for iOS 6 and fails with iOS 5

查看:29
本文介绍了iOS Ad-Hoc OTA 分发适用于 iOS 6,但在 iOS 5 中失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的 Ad-Hoc 构建的无线 (OTA) 分发有问题.使用基础 SDK 6.1、部署目标 5.0、架构 armv7 和 armv7s 构建通用 iPhone/iPad 应用程序.相同的临时版本在 iOS 6 设备(3 种不同的 iPhone5、一个 iPhone4 和 iPad2)上安装 OTA,但无法在 iOS 5 设备(iPhone4S 和 iPad1)上安装 OTA.

I'm having trouble with over the air (OTA) distribution for my Ad-Hoc builds. Building a universal iPhone/iPad app with base SDK 6.1, deployment target 5.0, architectures armv7 and armv7s. The very same ad-hoc build installs OTA on iOS 6 devices (3 different iPhone5, one iPhone4 and iPad2), but fails to install OTA on iOS 5 devices (iPhone4S and iPad1).

OTA 通过 IIS 进行,所有 MIME 类型设置正确(否则 iOS 6 将失败).

The OTA happens via IIS with all MIME types set properly (otherwise it would fail for iOS 6).

在 iOS 5 设备上,它开始安装,显示带有进度条的应用程序图标,第一个标题是正在等待...",然后更改为应用程序名称,然后显示警报视图

On iOS 5 devices it starts installation showin app icon with progress bar, first title is "Waiting...", then changes to app name, then alert view shows up saying

无法下载应用程序

目前无法下载.

完成/重试

将设备连接到 Xcode 以查看管理器中的日志.控制台有以下内容:

Connected device to Xcode to see logs in organizer. Console has the following:

apsd[48] :: 发生流错误:错误域=NSPOSIXErrorDomain 代码=61操作无法'-t -be -completed-.-Connection -refused-"-UserInfo-=-0-x-1-4-7-0-8-0 -{-}

apsd[48] : : Stream error occurred for : Error Domain=NSPOSIXErrorDomain Code=61 "The operation couldn’-t -b-e -c-o-m-p-l-e-t-e-d-. -C-o-n-n-e-c-t-i-o-n -r-e-f-u-s-e-d-" -U-s-e-r-I-n-f-o-=-0-x-1-4-7-0-8-0 -{-}

完全一样,包括-"字符.

Exactly like that, including "-" characters.

通过 iTunes 同步在相同的 iOS 5 设备上安装相同的 ad-hoc 构建按预期工作,没有错误.

Installing same ad-hoc build on same iOS 5 devices via iTunes sync works as expected, no errors.

帐户类型是普通"开发者帐户,而不是企业帐户.

Account type is a "plain" developer account, not Enterprise.

我已经尝试从头开始创建所有配置文件.尚未尝试删除和创建新证书,希望不是必需的.

I already tried to create all provisioning profiles from scratch. Didn't try to delete and create new certificates yet, hope it's not required.

App 不使用 iCloud 或 Pushes 或任何东西.捆绑包中不包含 Entitlements.plist.

App does not use iCloud or Pushes, or anything. No Entitlements.plist is included into the bundle.

值得一提的是,应用程序是使用 CocoaPods 构建的——一堆作为 Pods 目标构建的 3rd 方库.

Might be important to mention the fact that app is build with CocoaPods - a bunch of 3rd party libraries built as Pods target.

推荐答案

好吧,你肯定会惊讶地发现真正的原因是什么.

Well, you will sure be surprised to find out what an actual reason is.

我最终撤销了所有证书,删除了配置文件,从 CSR 一直到设置构建环境.我确实尝试了权利和get-task-allow"和其他东西.但这些都没有奏效.

I ended up revoking all certificates, removing profiles, going all the way from CSR to setting up a build environment. I did experiment with entitlements and 'get-task-allow' and other stuff. But none of that did the trick.

在某些时候,我决定再看看用于分发的 IIS 服务器和 plist 文件.所以在这里,问题出在 plist 文件上.iTunes 插图图像文件名为iTunesArtwork.png",plist 文件中的 url 为 http://hostname/Mobile/iOS/iTunesArtwork.

At some point I decided to have another look at IIS server and plist file used for distribution. So here it goes, the problem was with plist file. The iTunes artwork image file was named "iTunesArtwork.png", the url in plist file was http://hostname/Mobile/iOS/iTunesArtwork.

所以我将文件重命名为iTunesArtwork"(删除了扩展名),这并没有解决问题,但我现在可以看到安装进度条快要结束了,状态消息从正在下载"变为正在安装"".在此之前,它一开始就失败了,就在说等待"之后.

So I renamed the file to "iTunesArtwork" (removed extension), that didn't fix the problem, but I could now see the installation progress bar getting almost to the end and status message changing from "Downloading" to "Installing". Before that it failed at the very beginning, right after saying "Wait".

最后,我把所有的东西都整理好了,命名文件iTunesArtwork.png"并将url固定为http://hostname/Mobile/iOS/iTunesArtwork.png

Finally, I put all that stuff in order, named the file "iTunesArtwork.png" and fixed url to be http://hostname/Mobile/iOS/iTunesArtwork.png

这就是它起作用的时候.

And that's when it worked.

我只能想出以下解释:

在安装开始之前,iOS 会检查 plist 中的所有 url 是否都指向有效资源.如果其中任何一个失败,iOS 5 会中止安装,而 iOS 6 至少可以容忍无效的艺术品 url.

Before an installation starts, iOS is checking if all urls in plist point to valid resources. If any of that fails, iOS 5 aborts installation, while iOS 6 can at least tolerate invalid artwork url.

在安装过程中,iOS首先获取应用程序图标并将其显示在屏幕上,然后下载ipa文件,最后获取艺术品.再说一次,iOS 5 有更严格的验证规则,它不会喜欢像iTunesArtwork"这样的名称,我认为它只是不喜欢没有扩展名的文件名.如果获取图稿失败,则 iOS 5 上的整个安装将中止.在这个阶段,iOS 6 似乎忽略了错误.

During an installation, iOS first fetches app icon to display it on the screen, then downloads the ipa file, and in the end fetches artwork. Here, again, iOS 5 has stricter validation rules, it won't like names like 'iTunesArtwork', I think it just doesn't like file name with no extension. If fetching artwork fails the whole installation on iOS 5 is aborted. iOS 6 seems to ignore errors at this stage.

我个人认为 iOS 5 的做法是正确的.验证所有 url 都有效并且所有文件都具有正确的扩展名是一件好事.如果两个 iOS 版本都用同样的方式,我会在一开始就偶然发现这个问题.

I personally think that iOS 5 does it the right way. It is a good thing to validate that all urls are valid and all files have proper extension. If both iOS versions did it the same way, I would stumble upon the problem at the very beginning.

UPD

刚刚尝试在 Mac OS X 10.8 上运行 apache 网络服务器设置.可以肯定的是,与 IIS 不同,使用 apache 的 iOS 5 可以很好地容忍缺少的扩展,因此不仅仅是 iOS 5,而是 iOS 5 和 IIS 的混合导致所有麻烦.

Just tried with apache web server setup running on Mac OS X 10.8. Can tell for sure, unlike IIS, with apache iOS 5 tolerates missing extensions quite well, so it's not just iOS 5, but a mix of iOS 5 and IIS that causes all the trouble.

但是,如果我在 plist 中放置诸如 http://hostname/Mobile/iOS/NoSuchFile 之类的东西来代替艺术品,那么 iOS 5 将无法安装 OTA,而 iOS 6 则不会甚至注意到一件事并继续安装.

However, if I put stuff like http://hostname/Mobile/iOS/NoSuchFile in plist in place of artwork, then iOS 5 will fail to install OTA, while iOS 6 won't even notice a thing and proceed with installation.

这篇关于iOS Ad-Hoc OTA 分发适用于 iOS 6,但在 iOS 5 中失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆