ios9系统无法下载应用问题分析与解决

这篇博客详细记录了iOS9系统中遇到的应用下载失败的问题,通过系统日志分析,发现错误原因是由于应用的架构不匹配导致。作者提出了解决方案,即修改IPA打包配置,允许不严格校验架构,以兼容所有支持的设备。



苹果更新系统后,最近打包的ipa包在ios9系统上无法安装(ios8可以),
提示“无法下载应用”,经过一系列折腾解决了问题:

参考 http://www.cocoachina.com/bbs/read.php?tid-325154.html 
基本提供了以下几种解决路径,下面是折腾的过程:

1. 首先怀疑是http和https的问题,苹果更新系统要求所有请求都变成https,所以怀疑下载过程也要求这样,很快排除;

2.清除手机safari缓存,验证无效,但可能某些场景有效;
3.恢复网络设置,验证无效,但可能某些场景有效;
4.恢复出厂设置,验证无效,但可能某些场景有效;

5. 怀疑ipa的bundle id和服务器的plist上的bundle id不一致

查看服务器的plist文件,发现确实是这个原因引起,修改使之与ipa的
bundle id一致,解决;

但是后来发现新问题:
更新到9.0.2时发现5s以上设备可以安装,5c不行,反复查看了上面的解决路径5中方法,不得解,使用工具http://fir.im/tools/log_guru (很棒的开发者自己写的工具,原理就是将itunes可以看到的设备上所有log输出),直接看安装失败的log ,如下:

09:38:07 itunesstored[Download]: Reprioritizing to high task: 4 for download: 4270672922564713524

09:38:08 itunesstored[Download]: Reprioritizing to high task: 4 for download: 4270672922564713524

09:38:16 nsurlsessiondSocketStream watchdog timer fired after 65.000000 seconds of inactivity. Timing out the connection.

09:38:16 itunesstored[Download]: Retry scheduled for task: 4, download: 4270672922564713524, error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSErrorFailingURLStringKey=http://www.cmccim.com/resource/littlec_iOS_1.3.0.ipa, _kCFStreamErrorCodeKey=-2104, NSErrorFailingURLKey=http://www.cmccim.com/resource/littlec_iOS_1.3.0.ipa, NSLocalizedDescription=The request timed out., _kCFStreamErrorDomainKey=4}

09:38:17 itunesstored[Download]: Reset data consumer for task: 4, with resumption offset: 7810493

09:38:20 itunesstored[Download]: Download task did finish: 4 for download: 4270672922564713524

09:38:20 itunesstored[ApplicationWorkspace] Installing download: 4270672922564713524 with step(s): Install

09:38:20 itunesstored[ApplicationWorkspace]: Installing software package with bundleID: com.cmcchy.xiaoxi: bundleVersion: 1.3.0 path: /var/mobile/Media/Downloads/4270672922564713524/-556691672994417771

09:38:21 itunesstored[ApplicationWorkspace]: Bundle validated for bundleIdentifier: com.cmcchy.xiaoxi success: 1

09:38:21 itunesstoredLaunchServices: installing app for existing placeholder <LSApplicationProxy: 0x14ee3dc0> com.cmcchy.xiaoxi (Placeholder) <file:///private/var/mobile/Containers/Bundle/Application/8AD346A2-0B79-4E3E-A623-13FE5328B10A/4270672922564713524.app>

09:38:21 itunesstoredLaunchServices: Creating installProgressForApplication:<LSApplicationProxy: 0x14ee3dc0> com.cmcchy.xiaoxi (Placeholder) <file:///private/var/mobile/Containers/Bundle/Application/8AD346A2-0B79-4E3E-A623-13FE5328B10A/4270672922564713524.app> withPhase:1

09:38:21 installd0x40115000 -[MIClientConnection installPath:withOptions:completion:]: Install of "/var/mobile/Media/Downloads/4270672922564713524/-556691672994417771" type Customer requested by itunesstored (pid 310)

09:38:23 installd0x40081000 -[MIInstaller performInstallationWithError:]: Installing <MIInstallableBundle ID=com.cmcchy.xiaoxi; Version=1, ShortVersion=1.0>

09:38:24 profiled(Note ) MC: Provisioning profiles changed

09:38:24 profiled(Note ) MC: Updating MIS trust...

09:38:24 installd SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]

09:38:26 online-auth-agent SecTrustEvaluate  [leaf AnchorTrusted]

09:38:27 installd0x40081000 MIMachOFileMatchesMyArchitecture: 310: Failed to find matching arch for 64-bit Mach-O input file /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.KV3EvC/extracted/Payload/ChatDemo.app/ChatDemo

09:38:27 installd0x40081000 -[MIInstaller performInstallationWithError:]: Verification stage failed

09:38:28 itunesstored0x40081000 __MobileInstallationInstallForLaunchServices_block_invoke222: Returned error Error Domain=MIInstallerErrorDomain Code=15 "Failed to find matching arch for 64-bit Mach-O input file /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.KV3EvC/extracted/Payload/ChatDemo.app/ChatDemo" UserInfo={LegacyErrorString=IncorrectArchitecture, FunctionName=MIMachOFileMatchesMyArchitecture, NSLocalizedDescription=Failed to find matching arch for 64-bit Mach-O input file /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.KV3EvC/extracted/Payload/ChatDemo.app/ChatDemo, SourceFileLine=310}

09:38:28 itunesstoredERROR: MobileInstallationInstallForLaunchServices returned nil

09:38:28 itunesstoredLaunchServices: installPhaseFinishedForProgress: com.cmcchy.xiaoxi.Installing - <NSProgress: 0x14debe10> : Parent: 0x0 / Fraction completed: 0.0000 / Completed: 0 of 100   called, removing progress from cache

09:38:28 itunesstored[ApplicationWorkspace]: Failed to install application: com.cmcchy.xiaoxi; /var/mobile/Media/Downloads/4270672922564713524/-556691672994417771; Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=IncorrectArchitecture, ErrorDescription=Failed to find matching arch for 64-bit Mach-O input file /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.KV3EvC/extracted/Payload/ChatDemo.app/ChatDemo}

09:38:28 itunesstored[ApplicationWorkspace] Install complete for download: 4270672922564713524 result: Failed

09:38:28 itunesstored[Download]: Fail download: 4270672922564713524 after error: Error Domain=SSMobileInstallationErrorDomain Code=0 "(null)" UserInfo={SSErrorInstallErrorNameKey=IncorrectArchitecture}



所以怀疑是ipa打包配置需要改下,经分析可能是这里的问题:

47215B03-3E48-4DD3-8A62-687D1F30761D.png

将yes


将yes改为no,重新打包安装,解决~


猜测:可能是到9.0.2优先检查ipa的最高架构,假如支持了arm64就安装此架构到设备上,而iphone5c不支持arm64,这样就报了上面的错,修改这个配置就是让其不严格校验架构,可以兼容所有支持的架构。


苹果更新系统后,最近打包的ipa包在ios9系统上无法安装(ios8可以),
提示“无法下载应用”,经过一系列折腾解决了问题:

参考 http://www.cocoachina.com/bbs/read.php?tid-325154.html 
基本提供了以下几种解决路径,下面是折腾的过程:

1. 首先怀疑是http和https的问题,苹果更新系统要求所有请求都变成https,所以怀疑下载过程也要求这样,很快排除;

2.清除手机safari缓存,验证无效,但可能某些场景有效;
3.恢复网络设置,验证无效,但可能某些场景有效;
4.恢复出厂设置,验证无效,但可能某些场景有效;

5. 怀疑ipa的bundle id和服务器的plist上的bundle id不一致

查看服务器的plist文件,发现确实是这个原因引起,修改使之与ipa的
bundle id一致,解决;

但是后来发现新问题:
更新到9.0.2时发现5s以上设备可以安装,5c不行,反复查看了上面的解决路径5中方法,不得解,使用工具http://fir.im/tools/log_guru (很棒的开发者自己写的工具,原理就是将itunes可以看到的设备上所有log输出),直接看安装失败的log ,如下:

09:38:07 itunesstored[Download]: Reprioritizing to high task: 4 for download: 4270672922564713524

09:38:08 itunesstored[Download]: Reprioritizing to high task: 4 for download: 4270672922564713524

09:38:16 nsurlsessiondSocketStream watchdog timer fired after 65.000000 seconds of inactivity. Timing out the connection.

09:38:16 itunesstored[Download]: Retry scheduled for task: 4, download: 4270672922564713524, error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={NSErrorFailingURLStringKey=http://www.cmccim.com/resource/littlec_iOS_1.3.0.ipa, _kCFStreamErrorCodeKey=-2104, NSErrorFailingURLKey=http://www.cmccim.com/resource/littlec_iOS_1.3.0.ipa, NSLocalizedDescription=The request timed out., _kCFStreamErrorDomainKey=4}

09:38:17 itunesstored[Download]: Reset data consumer for task: 4, with resumption offset: 7810493

09:38:20 itunesstored[Download]: Download task did finish: 4 for download: 4270672922564713524

09:38:20 itunesstored[ApplicationWorkspace] Installing download: 4270672922564713524 with step(s): Install

09:38:20 itunesstored[ApplicationWorkspace]: Installing software package with bundleID: com.cmcchy.xiaoxi: bundleVersion: 1.3.0 path: /var/mobile/Media/Downloads/4270672922564713524/-556691672994417771

09:38:21 itunesstored[ApplicationWorkspace]: Bundle validated for bundleIdentifier: com.cmcchy.xiaoxi success: 1

09:38:21 itunesstoredLaunchServices: installing app for existing placeholder <LSApplicationProxy: 0x14ee3dc0> com.cmcchy.xiaoxi (Placeholder) <file:///private/var/mobile/Containers/Bundle/Application/8AD346A2-0B79-4E3E-A623-13FE5328B10A/4270672922564713524.app>

09:38:21 itunesstoredLaunchServices: Creating installProgressForApplication:<LSApplicationProxy: 0x14ee3dc0> com.cmcchy.xiaoxi (Placeholder) <file:///private/var/mobile/Containers/Bundle/Application/8AD346A2-0B79-4E3E-A623-13FE5328B10A/4270672922564713524.app> withPhase:1

09:38:21 installd0x40115000 -[MIClientConnection installPath:withOptions:completion:]: Install of "/var/mobile/Media/Downloads/4270672922564713524/-556691672994417771" type Customer requested by itunesstored (pid 310)

09:38:23 installd0x40081000 -[MIInstaller performInstallationWithError:]: Installing <MIInstallableBundle ID=com.cmcchy.xiaoxi; Version=1, ShortVersion=1.0>

09:38:24 profiled(Note ) MC: Provisioning profiles changed

09:38:24 profiled(Note ) MC: Updating MIS trust...

09:38:24 installd SecTrustEvaluate  [leaf IssuerCommonName SubjectCommonName]

09:38:26 online-auth-agent SecTrustEvaluate  [leaf AnchorTrusted]

09:38:27 installd0x40081000 MIMachOFileMatchesMyArchitecture: 310: Failed to find matching arch for 64-bit Mach-O input file /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.KV3EvC/extracted/Payload/ChatDemo.app/ChatDemo

09:38:27 installd0x40081000 -[MIInstaller performInstallationWithError:]: Verification stage failed

09:38:28 itunesstored0x40081000 __MobileInstallationInstallForLaunchServices_block_invoke222: Returned error Error Domain=MIInstallerErrorDomain Code=15 "Failed to find matching arch for 64-bit Mach-O input file /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.KV3EvC/extracted/Payload/ChatDemo.app/ChatDemo" UserInfo={LegacyErrorString=IncorrectArchitecture, FunctionName=MIMachOFileMatchesMyArchitecture, NSLocalizedDescription=Failed to find matching arch for 64-bit Mach-O input file /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.KV3EvC/extracted/Payload/ChatDemo.app/ChatDemo, SourceFileLine=310}

09:38:28 itunesstoredERROR: MobileInstallationInstallForLaunchServices returned nil

09:38:28 itunesstoredLaunchServices: installPhaseFinishedForProgress: com.cmcchy.xiaoxi.Installing - <NSProgress: 0x14debe10> : Parent: 0x0 / Fraction completed: 0.0000 / Completed: 0 of 100   called, removing progress from cache

09:38:28 itunesstored[ApplicationWorkspace]: Failed to install application: com.cmcchy.xiaoxi; /var/mobile/Media/Downloads/4270672922564713524/-556691672994417771; Error Domain=LaunchServicesError Code=0 "(null)" UserInfo={Error=IncorrectArchitecture, ErrorDescription=Failed to find matching arch for 64-bit Mach-O input file /private/var/mobile/Library/Caches/com.apple.mobile.installd.staging/temp.KV3EvC/extracted/Payload/ChatDemo.app/ChatDemo}

09:38:28 itunesstored[ApplicationWorkspace] Install complete for download: 4270672922564713524 result: Failed

09:38:28 itunesstored[Download]: Fail download: 4270672922564713524 after error: Error Domain=SSMobileInstallationErrorDomain Code=0 "(null)" UserInfo={SSErrorInstallErrorNameKey=IncorrectArchitecture}



所以怀疑是ipa打包配置需要改下,经分析可能是这里的问题:

47215B03-3E48-4DD3-8A62-687D1F30761D.png

将yes


将yes改为no,重新打包安装,解决~


猜测:可能是到9.0.2优先检查ipa的最高架构,假如支持了arm64就安装此架构到设备上,而iphone5c不支持arm64,这样就报了上面的错,修改这个配置就是让其不严格校验架构,可以兼容所有支持的架构。

评论 4
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值