一、背景
大家使用ios的app測試就會發現,安裝ios測試包很麻煩。 打包好的ipa包無法直接安裝,需要借助 i4助手類似的工具,而且要在PC端安裝。 當需要安裝包的人多時,使用很不方便。 於是今天這篇文章它來了
最終完成效果如下:
在手機輸入服務器地址,能直接選擇安裝app包到手機上, 幾秒安裝 (當然外網也有較多類似平台, 蒲公英平台 河馬分發等 考慮到信息安全,采用內部自行搭建)
二、環境依賴
需要 | 備注 |
---|---|
Web服務器 | 可以直接使用Mac上的Apache或者下載配置Nginx |
SSL證書 | 用來開啟HTTPS服務 |
HTTPS服務 | 根據蘋果官方文檔,對於iOS 7.1及以系統必須使用HTTPS |
HTML頁面 | 用來下載安裝包的頁面 |
IPA | 有個人開發者或者企業簽名的IPA包 |
manifest.plist | IPA對應的清單文件 |
icon | 57*57和512*512的圖片 |
1、web服務器: 搭建web的nginx參考此文章 https://www.jianshu.com/p/c3294887c6b6
2&3、SSL證書: https://www.jianshu.com/p/092049445f15
3、HTML:上圖中訪問ip后整個頁面,源碼參考:
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <meta http-equiv="Content-Style-Type" content="text/css"> <title></title> <meta name="Generator" content="Cocoa HTML Writer"> <meta name="CocoaVersion" content="1671"> <style type="text/css"> a {margin: 0.0px 0.0px 0.0px 0.0px; line-height: 48.0px; font: 48.0px Times; color: #0000e9} </style> </head> <body> <br> <br> <br> <p class="p3"><span class="s2"><a href="https://192.168.10.31/server.crt">====<span class="s3">安裝證書</span>====</a></span></p> <br> <br> <br> <p class="p3"><span class="s2"><a href="itms-services://?action=download-manifest&url=https://192.168.10.31/mainfest-aaa.plist(此處填寫你打包生成的plist文件)">====<span class="s3">你的應用名稱(隨便寫)</span>====</a></span></p> <br> <br> <br> </body> </html>
4、 plist文件可以直接使用xcode打包時生成
<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>https://192.168.10.31/Mobile.ipa</string> </dict> <dict> <key>kind</key> <string>display-image</string> <key>needs-shine</key> <true/> <key>url</key> <string>https://192.168.10.31/icon.png</string> </dict> </array> <key>metadata</key> <dict> <key>forceUpdate</key> <false/> <key>bundle-identifier</key> <string>包名或賬號名</string> <key>bundle-version</key> <string>4.4.0</string> <key>kind</key> <string>software</string> <key>title</key> <string>應用名</string> </dict> </dict> </array> </dict> </plist>
最后在手機上訪問時,先安裝證書,再設置信任