preface

Ipa developed by my company is published on AppStore and my own server. But I haven’t had time to use the company’s resources for research. Now strike while the iron is hot and record it for later reference.

Before this, I consulted relevant information on the Internet and sorted it out to improve and correct it.

background

The ipA package needs to be manually added. Plist file. I personally tested it today and found that Xcode 7 can be configured and generated. I’m going to go through my process here.

IPA package

  1. Select in the projectProductArchiveEnter the packaging interface
  2. chooseExportThe page for selecting a package mode is displayed
  3. chooseSave for Enterprise DeploymentOptions,Next
  4. Select the corresponding enterprise account and continue
  5. Next comes the selection of requirements for the installed devices, all of which are selected by default. The second option is to specify a specific type of device to install. We use the default first term,Next
  6. After that, the screen is a secondary validation of the APP to ensure that the APP configuration is correct. There’s one in the lower left of the windowInclude manifest for over-the-air installation. This option indicates whether building is taking place.ipaFile generated at the same time.plistFile, we check it,Next

    Over-the-air: OtAs are a feature Apple added in iOS4 to enable enterprise users to distribute their iOS apps wirelessly over the Web without being connected to the Apple App Store. Basically, you click a link in Safari to download and install the app on your iPhone or iPad (which is how many jailbreak apps are distributed).

  7. Next configuration.plistThe paperwork, when it’s filled out,Exportexport.ipaPackage and corresponding.plistFile (recommended to be generated.plistThe name of the file should be the same as the name of the APP.

Building site

Prerequisite for

  • Need to purchase an Apple enterprise edition certificate, the price is $299/ year. guide

  • The site must support HTTPS to access and download. Plist files

    There are two ways to do this:

    • One is to purchase an SSL certificate or apply for an SSL certificate for free.
    • The other is going to be.plistThe file is hosted on a third party and accessed and downloaded using HTTPS supported by the third party.

Code hosting using OSChina. Access OSChina to add a project; Then use Git or SVN client to commit the. Plist file to the repository. Finally, access the. Plist file in the project in the browser and view the original data to obtain the HTTPS download address of plist.

steps

Upload the. Plist and. Ipa files to the server for users to access. 2. Create a Web page that contains the following code. When the user clicks on the Web link, the. Plist file will be downloaded and triggered to download and install.

<a href="itms-services://? action=download-manifest&url=https://example.com/manifest.plist">Install App</a>
Copy the code

3. Configure the MIME type of the server. You may need to configure the Web server to transfer.

For OS X Server, add the MIME type to the MIME type setting for the Web service:

  • application/octet-stream ipa
  • text/xml plist

For Microsoft Internet Information Server (IIS), use IIS Manager to add MIME types to the Server properties page:

  • .ipa application/octet-stream
  • .plist text/xml

[Warning] Revoking the distribution certificate will invalidate all applications signed with the certificate. Revocation of certificates should be done only as a last resort, such as ensuring that the private key has been lost or that the certificate has been cracked.


Development zone

About wireless Manifest File (.plistFile)

The manifest file is an XML PList file that Apple devices can use to find, download, and install applications from your Web server. Manifest files are created by Xcode using the information you provide when sharing archiving applications for enterprise distribution. The following fields are mandatory:

  • URL:The fully qualified HTTPS URL of the application (.ipa) file
  • display-image:57 x 57 pixel PNG image, displayed during download and installation. Specifies the fully qualified URL of the image
  • full-size-image:A 512 x 512 pixel PNG image representing the corresponding app in iTunes
  • bundle-identifier:The package identifier for the application is exactly the same as specified in the Xcode project
  • bundle-version:The package version of the application, specified in the Xcode project
  • title:The name of the application displayed during download and installation

The sample manifest file (given below) also contains optional keys. For example, if the application file is too large and you want to ensure the integrity of the download based on error checking, which TCP communication typically does, you can use the MD5 key. You can install multiple applications using a manifest file by specifying additional members of the project array.

Example iOS app manifest file


      
<plist version="1.0">
<dict>
  <! -- array of downloads.-->
  <key>items</key>
  <array>
   <dict>
    <! -- an array of assets to download -->
     <key>assets</key>
      <array>
       <! -- software-package: the ipa to install.-->
        <dict>
         <! -- required. the asset kind.-->
          <key>kind</key>
          <string>software-package</string>
          <! -- optional. md5 every n bytes. will restart a chunk if md5 fails.-->
          <key>md5-size</key>
          <integer>10485760</integer>
          <! -- optional. array of md5 hashes for each "md5-size" sized chunk.-->
          <key>md5s</key>
          <array>
            <string>41fa64bb7a7cae5a46bfb45821ac8bba</string>
            <string>51fa64bb7a7cae5a46bfb45821ac8bba</string>
          </array>
          <! -- required. the URL of the file to download.-->
          <key>url</key>
          <string>https://www.example.com/apps/foo.ipa</string>
        </dict>
        <! -- display-image: the icon to display during download.-->
        <dict>
         <key>kind</key>
         <string>display-image</string>
         <! -- optional. indicates if icon needs shine effect applied.-->
         <key>needs-shine</key>
         <true/>
         <key>url</key>
         <string>https://www.example.com/image.57x57.png</string>
        </dict>
        <! -- full-size-image: the large 512x512 icon used by iTunes.-->
        <dict>
         <key>kind</key>
         <string>full-size-image</string>
         <! -- optional. one md5 hash for the entire file.-->
         <key>md5</key>
         <string>61fa64bb7a7cae5a46bfb45821ac8bba</string>
         <key>needs-shine</key>
         <true/>
         <key>url</key><string>https://www.example.com/image.512x512.jpg</string>
        </dict>
      </array>
<key>metadata</key>
      <dict>
       <! -- required -->
       <key>bundle-identifier</key>
       <string>com.example.fooapp</string>
       <! -- optional (software only) -->
       <key>bundle-version</key>
       <string>1.0</string>
       <! -- required. the download kind.-->
       <key>kind</key>
       <string>software</string>
       <! -- optional. displayed during download; typically company name -->
       <key>subtitle</key>
       <string>Apple</string>
       <! -- required. the title to display during the download.-->
       <key>title</key>
       <string>Example Corporate App</string>
      </dict>
    </dict>
  </array>
</dict>
</plist>

Copy the code

Apple’s official documentation for installing enterprise apps wirelessly

About correct extraction.plistFile download address posture

In the comments section, some friends have asked about the incorrect download location of.plist files. Here are several ways to do this:

2. When deploying the. Plist file on Github, click the RAW button on the. Plist page to obtain the correct address

.plist

Deploy the download page mode

1. Method 1: Enter the download page and click the Install APP button to download and install


      
<htmlxmlns="http://www.w3.org/1999/xhtml">
    <head>
        <metahttp-equiv="Content-Type"content="text/html; charset=utf-8"/ >
        <title>The application name</title>
    </head>
    <body>
        <h1style="font-size:80pt">If you cannot download the installation, copy the hyperlink and open it in your browser<h1/>
        <h1style="font-size:100pt">
        <a title="iPhone" href="itms-services://? action=download-manifest&url=https://example.com/manifest.plist">Install the APP</a><h1/>
    </body>
</html>
Copy the code

2. Method 2: Enter the download page and automatically download and install


      
<htmlxmlns="http://www.w3.org/1999/xhtml">
    <head>
        <metahttp-equiv="Content-Type"content="text/html; charset=utf-8"/ >
        <title>The application name</title>
        <script>
            var url ="https://example.com/manifest.plist";
            window.location ="itms-services://? action=download-manifest&url="+ url;
        </script>
    </head>
    <body>
    </body>
</html>
Copy the code

3. Method 3: Install through the iOS app

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"itms-services://? action=download-manifest&url=https://example.com/manifest.plist"]].Copy the code

4. Method 4: The ultimate trick is to directly use third-party hosting platform (two common platforms are recommended)

  1. Fir. Im – free application closed Beta distribution | | cisco iOS application hosting platform Android closed Beta distribution
  2. Dandelion – free hosting platform | App application the measured distribution
  3. TestFlight Beta Testing – App Store – Apple Developer

Installation failure Cause

The IPA installation using enterprise certificates may fail. For common failure causes, see Troubleshooting iOS application Installation Failure Causes


Thank you again for taking the time to read this article!

Weibo: @danny_ Lu Changhui blog: SuperDanny