zoukankan      html  css  js  c++  java
  • 不通过AppStore,在iOS设备上直接安装应用程序的原理

    本文转载至  http://mobile.51cto.com/hot-439095.htm

    通过itms-services协议,可以通过safari浏览器直接在iOS设备上安装应用程序。利用这种方式,只要在内网布置一个服务器,测试人员只需要通过测试设备的safari浏览器访问特定的url既可以实现安装,然后测试了。

    AD:WOT2015 互联网运维与开发者大会 热销抢票

    通过itms-services协议,可以通过safari浏览器直接在iOS设备上安装应用程序。利用这种方式,只要在内网布置一个服务器,测试人员只需要通过测试设备的safari浏览器访问特定的url既可以实现安装,然后测试了。(PS:越狱设备也可以)

    itms- services协议需要一个plist配置文件。如果要实现上面图示的功能,需要的文件有:一个ipa文件,一个plist文件,一个html文件和一 个图片文件。其中,最主要的,就是plist文件。通过shell脚本,我们可以让其自动为我们生成plist文件和html文件,并且在xcode工程 中的ipa文件和程序图标文件复制一份,放到一起。

    《xcode自动打ipa包脚本》学习地址:http://webfrogs.me/2012/09/19/buildipa/

    plist文件范例如下:

    1. <?xml version="1.0" encoding="UTF-8"?>   
    2. <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">   
    3. <plist version="1.0">   
    4. <dict>   
    5.    <key>items</key>   
    6.    <array>   
    7.        <dict>   
    8.            <key>assets</key>   
    9.            <array>   
    10.                <dict>   
    11.                    <key>kind</key>   
    12.                    <string>software-package</string>   
    13.                    <key>url</key>   
    14.                    <string>ipa包的下载地址,如:http://www.tammy.com:450/static/ios/(targetname)_(version)_build(buildversion)_yyyyMMdd.ipa</string>   
    15.                </dict>   
    16.            </array>   
    17.            <key>metadata</key>   
    18.            <dict>   
    19.                <key>bundle-identifier</key>   
    20.                <string>应用程序中的<span style="font-family:FangSong_GB2312">bundle-identifier</span><span style="font-family:FangSong_GB2312"></string></span>   
    21.                <key>bundle-version</key>   
    22.                <string>版本号</string>   
    23.                <key>kind</key>   
    24.                <string>software</string>   
    25.                <key>subtitle</key>   
    26.                <string>子标题</string>   
    27.                <key>title</key>   
    28.                <string>软件名称</string>   
    29.            </dict>   
    30.        </dict>   
    31.    </array>   
    32. </dict>   
    33. </plist>   

    html文件范例如下:

    1. <span style="font-size:12px"><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">   
    2. <html>   
    3. <head>   
    4.   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">   
    5.   <meta http-equiv="Content-Style-Type" content="text/css">   
    6.   <title>测试包安装</title>   
    7. </head>   
    8. <body>   
    9. <br>   
    10. <div style="position:absolute;left:200px" width=400><href="../index.html">返回</a></div>   
    11.     <h1 align="center">开发版(TRUNK)</h1>   
    12.     <table align="center" border=width=400>   
    13.     <tr height=60>   
    14.         <th colspan=2><h2>标题</h2></th>   
    15.     </tr>   
    16.     <tr height=60 align="center">   
    17.         <td width=200><href="itms-services://?action=download-manifest&url=</span><span style="font-size:10px"><span style="font-family:FangSong_GB2312">http://www.tammy.com:450/static/ios/****.plist</span><span style="font-family:FangSong_GB2312">"><h2>Install</h2></a></td></span></span><span style="font-size:12px">   
    18.         <td width=200><href="</span><pre name="code" class="html" style="color:rgb(34,34,34); line-height:22px">http://www.tammy.com:450/static/ios/(targetname)_(version)_build(buildversion)_yyyyMMdd.ipa</pre>"><h2>Download</h2></a></td></tr>    </table><br></body></html

    不通过App Store,直接安装应用程序的实现步骤:

    1、设置签名

    利用developer profile或者adhoc distribution profile签名app,注意,不能使用distribution profile方式签名;个人开发者证书只能在100个设备中实现无线安装。

    2、生成arichive

    菜单:product->archive,完成后可以在organizer中看到生成的arichive。

    3、生成ipa

    选择刚刚生成的arichive,点击“Distribute...",弹出如下图界面,选择第二个,点“next”,设置相关参数,一 定要勾选“save for enterprise distribution”。application url,是生成的ipa在服务器的位置;title是安装过程中出现的标题;large image url 和 smal image url是安装过程中出现的图标。点击保存,将生成两个文件:***.ipa和***.plist。

    4、服务器部署

    将生成的***.ipa和***.plist文件部署到服务器,同时在服务器生成一个html文件,目的是点击后打开一个链接,这样ios设备就会执行指令自动安装app了。要打开的链接内容如下:

    itms-services://?action=download-manifest&url=http://www.tammy.com:450/static/ios/****.plist

  • 相关阅读:
    IOS:个人笔记|UI_UITableView的优化
    IOS:个人笔记|UI_UITableView
    java基础知识记录(2)
    斐波那契数列
    字符串中数字排序,给定一个字符串“12 33 31 42 ”,或者键盘输入,进行排序
    java基础知识记录(1)
    【Unity】实验二 游戏场景搭建
    Error:java: Compilation failed: internal java compiler error 解决
    Github + Picgo + Typora 让笔记远走高飞
    remote: Incorrect username or password ( access token ) fatal: Authentication failed for
  • 原文地址:https://www.cnblogs.com/Camier-myNiuer/p/4245544.html
Copyright © 2011-2022 走看看