iOS 企业 OTA 分发无法下载应用程序

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

iOS Enterprise OTA distribution Unable to Download Application

iosenterpriseover-the-air

提问by user1282931

I created an iOS app and want to distribute it Over-The-Air. I followed this guide:

我创建了一个 iOS 应用程序并希望通过无线方式分发它。我遵循了本指南:

http://help.apple.com/iosdeployment-apps/mac/1.1/?lang=en-us#app43ad77ea

http://help.apple.com/iosdeployment-apps/mac/1.1/?lang=en-us#app43ad77ea

The App is signed with the enterprise certificate and contains the distribution provisioning profile.

该应用程序使用企业证书进行签名并包含分发配置文件。

When I try to download the App onto the ipad (using the technique described in this guide), a square icon with my download icon appears on the screen with the name "Waiting...", then a second later the name changes to my actual application name and then again a second later i receive the error message:

当我尝试将应用程序下载到 ipad 上时(使用本指南中描述的技术),屏幕上会出现一个带有我的下载图标的方形图标,名称为“正在等待...”,然后一秒钟后名称更改为我的实际的应用程序名称,然后一秒钟后我再次收到错误消息:

Unable to Download Application

"Your Application" could not be downloaded at this time.

无法下载应用程序

此时无法下载“您的应用程序”。

in the guide, there are three troubleshooting tips:

在指南中,有三个故障排除提示:

if wireless app distribution fails with an “unable to download” message, check the following:

Make sure the app is signed correctly. Test it by installing it on a device using iPhone Configuration Utility or Apple Configurator, and see if any errors occur.

Make sure the link to the manifest file is correct and the manifest file is accessible to web users.

Make sure the URL to the .ipa file (in the manifest file) is correct and the .ipa file is accessible to web users.

如果无线应用程序分发失败并显示“无法下载”消息,请检查以下内容:

确保应用程序签名正确。使用 iPhone 配置实用程序或 Apple Configurator 将其安装在设备上进行测试,看看是否出现任何错误。

确保清单文件的链接正确,并且网络用户可以访问清单文件。

确保 .ipa 文件(在清单文件中)的 URL 正确,并且 .ipa 文件可供网络用户访问。

I checked all three things and they are fine.

我检查了所有三个东西,它们都很好。

What else could cause my download problems?

还有什么可能导致我的下载问题?

回答by cregox

As alexeymentioned, too many reasons can cause that message. Apple use it as a "catch all errors".

正如阿列克谢所说,导致该消息的原因太多。Apple 将其用作“捕获所有错误”。

You can diagnose it through the Console. Connect the device to your desktop and access it either from XCode's Organizer(mac only) or iPhone Configuration Utility(mac and windows). But...

您可以通过Console进行诊断。将设备连接到桌面并从XCode 的管理器(仅限 Mac)或iPhone 配置实用程序(Mac 和 Windows)访问它。但...

It just ain't that simple! :-(

简直没那么简单!:-(

Consolemay be far from enough. Sometimes there is no relevant messagethere.

控制台可能还远远不够。有时那里没有相关消息

Then, the last resort is following a checklist. Doing all over from zero again. There are many outthere... But following there's my generic and non-detailed checklist for Over The Air distribution, at the moment.

然后,最后的手段是遵循清单。一切从零开始。有很多......但以下有我的泛型和非详尽的在空气分配清单,此刻。





  1. Have a Distribution build- This is the most complicated part, done always on the web, and Apple changes the steps all the time. In general, you need a certificate, an identifierand the provisioning profile. Listing devices is almostalways required. My current choice is "Distribution -> In House".

    Apple Developer ->Member Center ->Certificates, Identifiers & Profiles ->Provisioning Profiles ->Add (+)

    P.S.: If you do want to list the devices, make sure the UDIDs are correct. Many issues reported here.

  2. Set the profile under Project -> Build Settings- Since XCode 5, things changed. Instead of code signingwith an identityyou can clear all that up and set it under *Code Signing -> *Provisioning Profile. The Identity should automatically change to "Automatic". There's also no more need to manually download files from step 1 and install them. XCode manages that now.

    XCode 5 ->Project Navigator ->Project ->Build Settings

  3. Archive- In Xcode 5, there's no need any more to "Build for Archive". Just archive it. It should show up next on Organizer, and it will take some time if it's a big project. Many errors can come up on this step, but they're almost always related to code compilation and not to OTA.

  4. Deploy- Now in Organizer -> Archives, select the proper archive (should be already selected as the most recent one) click on "Distribute", then Save for Enterprise or Ad Hoc Deployment. May be big wait now. When saving the file, there is an option to "Save for Enterprise Distribution". That is a completely misleading name. What it really does is create the plistfile. If you have one already, it's fine. You can even manually edit it, which is generally better. The plistbe needed for step (5). Here's a good one:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>items</key>
        <array>
            <dict>
                <key>assets</key>
                <array>
                    <dict>
                        <key>kind</key>
                        <string>software-package</string>
                        <key>url</key>
                        <string>http://example.com/app.ipa</string>
                    </dict>
                    <dict>
                        <key>kind</key>
                        <string>full-size-image</string>
                        <key>needs-shine</key>
                        <false/>
                        <key>url</key>
                        <string>http://example.com/FullSizeImage.png</string>
                    </dict>
                    <dict>
                        <key>kind</key>
                        <string>display-image</string>
                        <key>needs-shine</key>
                        <false/>
                        <key>url</key>
                        <string>http://example.com/Icon.png</string>
                    </dict>
                </array>
                <key>metadata</key>
                <dict>
                    <key>bundle-identifier</key>
                    <string>com.example.app</string>
                    <key>kind</key>
                    <string>software</string>
                    <key>subtitle</key>
                    <string>for iOS</string>
                    <key>title</key>
                    <string>My App</string>
                </dict>
            </dict>
        </array>
    </dict>
    </plist>
    
  5. Distribute- Skip this step if you want to install it using XCode or iPhone Configuration Utility. You're done. This is putting on the file on a web site. "Simply" add a HTML page with a hreflink such as this:

     itms-services://?action=download-manifest&url=http://example.com/app.plist
    

    Unfortunately dealing with web servers is never simple. So also check the server mime-type! I've made a couple PHP files to deal with them, if your server supports php. Just keep your files as they are (the plist, htmland ipa) and link to app.plist.phpinstead:

    app.plist.php

    $file = fopen("app.plist", "r");
    while(!feof($file)){
        $line = fgets($file);
        print str_replace(".ipa", ".ipa.php", $line);
    }
    fclose($file);
    ?>
    

    app.ipa.php

    <?php
    header('Content-type: application/octet-stream');
    
    $file = fopen("app.ipa", "r");
    while(!feof($file)){
        $line = fgets($file);
        print $line;
    }
    fclose($file);
    ?>
    
  6. Verify- Ensure that all files listed in the assets array are available to download. If any of these files return 404 or such (including the icons) the entire install will fail. You must either (A) make those files available or (B) delete those missing entries from the plist. The icon entries are not required for the download to work.

    Here is an example plist with no icons:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>items</key>
        <array>
            <dict>
                <key>assets</key>
                <array>
                    <dict>
                        <key>kind</key>
                        <string>software-package</string>
                        <key>url</key>
                        <string>http://example.com/app.ipa</string>
                    </dict>
                </array>
                <key>metadata</key>
                <dict>
                    <key>bundle-identifier</key>
                    <string>com.example.app</string>
                    <key>kind</key>
                    <string>software</string>
                    <key>subtitle</key>
                    <string>for iOS</string>
                    <key>title</key>
                    <string>My App</string>
                </dict>
            </dict>
        </array>
    </dict>
    </plist>
    
  1. 有一个分发版本——这是最复杂的部分,总是在网络上完成,Apple 一直在改变步骤。通常,您需要一个证书、一个标识符配置文件几乎总是需要列出设备。我目前的选择是“分销->内部”。

    Apple Developer ->Member Center ->Certificates, Identifiers & Profiles ->Provisioning Profiles ->Add (+)

    PS:如果您确实想列出设备,请确保 UDID 是正确的。这里报告了许多问题。

  2. 在 Project -> Build Settings 下设置配置文件- 从 XCode 5 开始,事情发生了变化。取而代之的代码签名身份可以清除所有并设置它在*代码签名- > *供应配置文件。身份应自动更改为“自动”。也不再需要从步骤 1 手动下载文件并安装它们。XCode 现在管理。

    XCode 5 ->项目导航器 ->项目 ->构建设置

  3. 存档- 在 Xcode 5 中,不再需要“为存档构建”。存档就行了 接下来应该会出现在Organizer 上,如果它是一个大项目,则需要一些时间。这一步可能会出现许多错误,但它们几乎总是与代码编译有关,而不是与 OTA 相关。

  4. 部署- 现在在Organizer -> Archives 中,选择正确的存档(应该已经被选为最新的),点击“ Distribute”,然后点击Save for Enterprise 或 Ad Hoc Deployment。现在可能要等很久了。保存文件时,有一个选项“保存为企业分发”。这是一个完全具有误导性的名称。它真正做的是创建plist文件。如果你已经有了,那很好。您甚至可以手动编辑它,这通常会更好。的plist中需要为步骤(5)。这是一个很好的:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>items</key>
        <array>
            <dict>
                <key>assets</key>
                <array>
                    <dict>
                        <key>kind</key>
                        <string>software-package</string>
                        <key>url</key>
                        <string>http://example.com/app.ipa</string>
                    </dict>
                    <dict>
                        <key>kind</key>
                        <string>full-size-image</string>
                        <key>needs-shine</key>
                        <false/>
                        <key>url</key>
                        <string>http://example.com/FullSizeImage.png</string>
                    </dict>
                    <dict>
                        <key>kind</key>
                        <string>display-image</string>
                        <key>needs-shine</key>
                        <false/>
                        <key>url</key>
                        <string>http://example.com/Icon.png</string>
                    </dict>
                </array>
                <key>metadata</key>
                <dict>
                    <key>bundle-identifier</key>
                    <string>com.example.app</string>
                    <key>kind</key>
                    <string>software</string>
                    <key>subtitle</key>
                    <string>for iOS</string>
                    <key>title</key>
                    <string>My App</string>
                </dict>
            </dict>
        </array>
    </dict>
    </plist>
    
  5. 分发- 如果您想使用 XCode 或 iPhone 配置实用程序安装它,请跳过此步骤。你完成了。这是把文件放在网站上。“简单地”添加一个带有href链接的 HTML 页面,例如:

     itms-services://?action=download-manifest&url=http://example.com/app.plist
    

    不幸的是,处理 Web 服务器从来都不是一件简单的事情。所以还要检查服务器 mime-type!如果您的服务器支持 php,我已经制作了几个 PHP 文件来处理它们。只需保持文件原样(plisthtmlipa)并链接到app.plist.php

    应用程序.plist.php

    $file = fopen("app.plist", "r");
    while(!feof($file)){
        $line = fgets($file);
        print str_replace(".ipa", ".ipa.php", $line);
    }
    fclose($file);
    ?>
    

    应用程序.ipa.php

    <?php
    header('Content-type: application/octet-stream');
    
    $file = fopen("app.ipa", "r");
    while(!feof($file)){
        $line = fgets($file);
        print $line;
    }
    fclose($file);
    ?>
    
  6. 验证- 确保资产数组中列出的所有文件均可下载。如果这些文件中的任何一个返回 404 或类似信息(包括图标),则整个安装将失败。您必须 (A) 使这些文件可用或 (B) 从 plist 中删除那些丢失的条目。下载工作不需要图标条目。

    这是一个没有图标的示例 plist:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>items</key>
        <array>
            <dict>
                <key>assets</key>
                <array>
                    <dict>
                        <key>kind</key>
                        <string>software-package</string>
                        <key>url</key>
                        <string>http://example.com/app.ipa</string>
                    </dict>
                </array>
                <key>metadata</key>
                <dict>
                    <key>bundle-identifier</key>
                    <string>com.example.app</string>
                    <key>kind</key>
                    <string>software</string>
                    <key>subtitle</key>
                    <string>for iOS</string>
                    <key>title</key>
                    <string>My App</string>
                </dict>
            </dict>
        </array>
    </dict>
    </plist>
    

The file examples are a very important part of the checklist. They have to be 100% correct.

文件示例是清单中非常重要的部分。他们必须是 100% 正确的。

Double check the plist and html files!

仔细检查 plist 和 html 文件!

P.S.: I'm writing this answer because, in my case, it was a "simple" matter of wrong link on the .plistfile. And, as such, it's hard as hell to diagnose. Well, only doing this checklist could I find the error! It was pointing to "another-app.ipa" rather than "app.ipa"!

PS:我写这个答案是因为,就我而言,这是.plist文件上错误链接的“简单”问题。而且,因此,诊断起来非常困难。好吧,只有执行此检查表才能找到错误!它指向“another-app.ipa”而不是“app.ipa”!

回答by alexey

There are a plenty of reasons to cause this message.

导致此消息的原因有很多。

The best way to diagnose it is to connect a device to Macand look Consolefor the device in Organizer.

诊断它的最佳方法是将设备连接到 Mac并在Organizer 中查找设备的控制台

In my case, for example, it was:

例如,就我而言,它是:

verify_bundle_metadata: This app was not build to support this device family

verify_bundle_metadata:此应用程序不是为支持此设备系列而构建的

回答by user1282931

Answering my own question:

回答我自己的问题:

The problem was that one of the thumbnails did not have the correct path set in the manifest.plist - so not only the ipa needs the correct path, but also the temporary download icons, otherwise the installation will fail with the mentioned error message.

问题是其中一个缩略图在 manifest.plist 中没有设置正确的路径 - 因此不仅 ipa 需要正确的路径,还需要临时下载图标,否则安装将失败并显示上述错误消息。

回答by Gary Keeler

Another Issue that it could be is that both the .plist ANDthe .ipa need to be hosted with HTTPS and not just regular HTTP. The software package string should look like below:

另一个可能的问题是 .plist.ipa 都需要使用 HTTPS 托管,而不仅仅是常规 HTTP。软件包字符串应如下所示:

<key>kind</key>
<string>software-package</string>
<key>url</key>
<string>https://example.com/app.ipa</string>

Stupid little oversight but it was tripping me up for awhile.

愚蠢的小疏忽,但它让我绊倒了一段时间。

回答by Christoph

We did experience the very same error message when trying to install an iOS 5+ app to an iOS4.3.5 phone. Did you also check deployment/build targets and target architecture to match the device(s) showing that issue?

在尝试将 iOS 5+ 应用程序安装到 iOS4.3.5 手机时,我们确实遇到了相同的错误消息。您是否还检查了部署/构建目标和目标架构以匹配显示该问题的设备?

回答by Tim Glenn

Make sure the casing is matching in all the files. They tend to be case insensitive.

确保所有文件中的大小写都匹配。它们往往不区分大小写。

回答by Irfan DANISH

In my case the issue was on my device an older version of same app was installed with same bundle identifier (downloaded from applstore) so now when I was trying to download its new version via enterprise distribution it was doing nothing, no error at all. Delete existing version from the device solved my issue.

在我的情况下,问题出在我的设备上,同一应用程序的旧版本安装了相同的捆绑标识符(从 applstore 下载),所以现在当我尝试通过企业分发下载其新版本时,它什么也没做,根本没有错误。从设备中删除现有版本解决了我的问题。

回答by Nik Kov

I found in console.

我在控制台中找到了。

installcoordinationd(MobileInstallation)[99] : ****bundleID****:5:11:1:1:Updating PlaceholderMetadata for ****bundleID**** with failure 1 _LSInstallType 1, underlyingError (Error Domain=MIInstallerErrorDomain Code=13 "Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.IoCSM9/extracted/Payload/App.app : 0xe8008016 (The executable was signed with invalid entitlements.)" UserInfo={LibMISErrorNumber=-402620394, LegacyErrorString=ApplicationVerificationFailed, SourceFileLine=147, FunctionName=+[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:], NSLocalizedDescription=Failed to verify code signature of /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.IoCSM9/extracted/Payload/App.app : 0xe8008016 (The executable was signed with invalid entitlements.)}), source 17>

installcoordinationd(MobileInstallation)[99] : ****bundleID****:5:11:1:1:Updating PlaceholderMetadata for ****bundleID**** with failure 1 _LSInstallType 1,underlyingError (Error Domain=MIInstallerErrorDomain代码=13“无法验证 /private/var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.IoCSM9/extracted/Payload/App.app 的代码签名:0xe8008016(可执行文件的签名是无效的权利。)" UserInfo={LibMISErrorNumber=-402620394, LegacyErrorString=ApplicationVerificationFailed, SourceFileLine=147, FunctionName=+[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:], NSLocalizedDescription=无法验证 /private/Library/installd 的代码签名/Caches/com.apple.mobile.installd.staging/temp.IoCSM9/extracted/Payload/App.app :0xe8008016(可执行文件的签名无效。)}),来源 17>

Here we should look at:
Failed to verify code signature of App.app
The executable was signed with invalid entitlements.

这里我们应该看看:
Failed to verify code signature of App.app
The executable was signed with invalid entitlements.

In my case it was because i downloaded enterprise build from amazon. But the provisioning profile, which it was builded with, was expired (figured out in developer console).

就我而言,这是因为我从亚马逊下载了企业版。但是构建它的配置文件已过期(在开发人员控制台中发现)。



Another one with the other purpose:

另一个有另一个目的:

"This app could not be installed at this time." UserInfo={NSLocalizedDescription=This app could not be installed at this time., NSUnderlyingError=0x100cbd3c0 {Error Domain=MIInstallerErrorDomain Code=64 "Upgrade's application-identifier entitlement string (BBBUUUU.com.bundle.www) does not match installed application's application-identifier string (CCCEEEE.com.bundle.www); rejecting upgrade." UserInfo={LegacyErrorString=MismatchedApplicationIdentifierEntitlement, FunctionName=-[MIInstallableBundle _validateApplicationIdentifierForNewBundleSigningInfo:error:], SourceFileLine=878, NSLocalizedDescription=Upgrade's application-identifier entitlement string (BBBUUUU.com.bundle.www) does not match installed application's application-identifier string (CCCEEEE.com.bundle.www); rejected

“目前无法安装此应用程序。” UserInfo={NSLocalizedDescription=此时无法安装此应用程序。, NSUnderlyingError=0x100cbd3c0 {Error Domain=MIInstallerErrorDomain Code=64 "升级的应用程序标识符授权字符串 (BBBUUUU.com.bundle.www) 与已安装应用程序的应用程序不匹配-标识符字符串 (CCCEEEE.com.bundle.www);拒绝升级。” UserInfo={LegacyErrorString=MismatchedApplicationIdentifierEntitlement, FunctionName=-[MIInstallableBundle _validateApplicationIdentifierForNewBundleSigningInfo:error:], SourceFileLine=878, NSLocalizedDescription=Upgrade's application-identifier entitlement string (BBBUUUU.com.bundle.www 的application-identifier entitlement string (BBBUUUU.com.bundle.www) 的application-identifier .com.bundle.www);拒绝了

Here i just removed the previous version of the app. The error was, because i changed the team for the bundle ID and it was installed the app with previous bundle ID.

在这里,我刚刚删除了该应用程序的先前版本。错误是,因为我更改了捆绑 ID 的团队,并且使用以前的捆绑 ID 安装了应用程序。



Open console with:

打开控制台:

  • Xcode> Window> Devices
  • Select the device
  • Expand a console with with a box with an arrow inside of it in the bottom left corner.
  • Xcode> Window>Devices
  • 选择设备
  • 在左下角用一个带有箭头的框展开控制台。

回答by atereshkov

In my case, there was a problem with incorrect file permissions of the FTP folder and the files inside (manifest, ipa, images). Check that they have 775 (rwx) and that Owner/Group is your owner.

就我而言,FTP 文件夹和其中的文件(清单、ipa、图像)的文件权限不正确存在问题。检查他们是否有 775 (rwx) 并且所有者/组是您的所有者。

The error in the device console was like "Cannot connect to iTunes Store" or "Failed artwork for bundleID" or "Failed to load placeholder artwork for bundleID". But it's just about the files.

设备控制台中的错误类似于“无法连接到 iTunes Store”或“ bundleID 的插图失败”或“无法加载 bundleID 的占位符插图”。但这只是关于文件。

回答by Lakhwinder

In my case I did following to get rid off "cannot connect to dl.dropboxusercontent" message after providing ipa shared link. 1. Removed md5 section from plist 2. Uploaded 512*512 and 57*57 images to drop box, and provided shared link in fill_size_image and display_image in plist.

就我而言,在提供 ipa 共享链接后,我做了以下操作以摆脱“无法连接到 dl.dropboxusercontent”消息。1. 从 plist 中删除了 md5 部分 2. 将 512*512 和 57*57 图像上传到下拉框,并在 plist 中的 fill_size_image 和 display_image 中提供共享链接。