iOS企业OTA分发无法下载应用程序 [英] iOS Enterprise OTA distribution Unable to Download Application

查看:181
本文介绍了iOS企业OTA分发无法下载应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个iOS应用程序,并希望通过空中分发它。我遵循了这个指南:



!如果您的服务器支持php,我已经制作了几个PHP文件来处理它们。只需按原样保存文件( plist html ipa ),然后链接到应用。 plist.php 代替:



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);
打印$ line;
}
fclose($ file);
?>


  • 验证 - 确保资产数组中列出的所有文件可以下载。如果这些文件中的任何一个返回404或其他(包括图标),则整个安装将失败。您必须(A)使这些文件可用或(B)从plist中删除那些丢失的条目。下载工作不需要图标条目。



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

     <?xml version =1.0encoding =UTF-8?> 
    <!DOCTYPE plist PUBLIC - // Apple // DTD PLIST 1.0 // ENhttp://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>元数据< / key>
    < dict>
    < key> bundle-identifier< / key>
    < string> com.example.app< / string>
    < key> kind< / key>
    < string>软件< / string>
    < key> subtitle< / key> iOS< / string>的
    < string>
    < key> title< / key>
    < string>我的应用< / string>
    < / dict>
    < / dict>
    < / array>
    < / dict>
    < / plist>


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



    仔细检查plist和html文件!



    PS:我正在写这个答案,因为在我的情况下,这是 .plist 文件中错误链接的简单问题。而且,因此,诊断很难。好吧,只有这个清单才能找到错误!它指的是另一个app.ipa,而不是app.ipa!


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

    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:

    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.

    I checked all three things and they are fine.

    What else could cause my download problems?

    解决方案

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

    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...

    It just ain't that simple! :-(

    Console may be far from enough. Sometimes there is no relevant message there.

    Then, the last resort is following a checklist. Doing all over from zero again. There are many out there... 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 identifier and the provisioning profile. Listing devices is almost always required. My current choice is "Distribution -> In House".

      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 signing with an identity you 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.

    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 plist file. If you have one already, it's fine. You can even manually edit it, which is generally better. The plist be 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 href link 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, html and ipa) and link to app.plist.php instead:

      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>
      

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

    Double check the plist and html files!

    P.S.: I'm writing this answer because, in my case, it was a "simple" matter of wrong link on the .plist file. 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"!

    这篇关于iOS企业OTA分发无法下载应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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