iOS OTA無線安裝App

今天使用蒲公英給別人發測試 APP(一個遊戲的重簽名包) 的時候被封禁了,在尋找其餘的分發方法的時候順便也探討了下蒲公英的這個 app 分發機制.html

1.OTA 概念

OTA 即 Over-the-Air,是 Apple 在 iOS4 中新加的一項技術,目的是讓開發者可以脫離 Appstore,實現從服務器下載並安裝 iOS 應用。 用戶只須要在 iOS 設備的瀏覽器中,打開itms-services://協議連接,就能夠直接安裝App。(注意:此處的安裝是指,我的帳號須要註冊設備,企業帳號無需註冊設備)git

2.所需資源

    1. ipa 包
    • 企業帳號簽名包,用戶只需信任企業開發者就能安裝
    • ad hoc包,須要描述文件中包含的設備才能安裝
    1. manifest.plist
    1. icon文件,(2張)尺寸:512x5十二、57x57 (不重要)
    1. 一個簡單的 html 靜態頁面

manifest.plist內容github

<?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>xxx.ipa</string>
				</dict>
				<dict>
					<key>kind</key>
					<string>display-image</string>
					<key>url</key>
					<string>xxx/icon-57.png</string>
				</dict>
				<dict>
					<key>kind</key>
					<string>full-size-image</string>
					<key>url</key>
					<string>xxx/icon-1024.png</string>
				</dict>
			</array>
			<key>metadata</key>
			<dict>
				<key>bundle-identifier</key>
				<string>xxx.xxx.xxx</string>
				<key>bundle-version</key>
				<string>1.0.x</string>
				<key>kind</key>
				<string>software</string>
				<key>title</key>
				<string>xxxx</string>
			</dict>
		</dict>
	</array>
</dict>
</plist>
複製代碼
字段 描述
software-package ipa 文件所在地址
display-image 圖標縮略圖
full-size-image 圖標全尺寸
bundle-identifier 包名 com.xxx.xx
bundle-version 版本 1.0.x
title 應用名

靜態 html 頁面 頁面長啥樣不重要,重要的是要有如下代碼瀏覽器

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>標題</title>
</head>
<body>
<a href="itms-services://?action=download-manifest&url=manifest.plist的地址">點擊安裝</a>
</body>
</html>

複製代碼

3.操做步驟

若是 ipa 包自己小於100MB 的話,用 gitee 或者 github 也能夠,有能力的能夠本身搭建服務器. 我以騰訊云爲例,新用戶能夠免費領取6個月的對象存儲 COSbash

把咱們以前準備好的文件都傳到服務器上服務器

正確順序應該是先傳 ipa 和兩個圖片,有了具體地址後填好 manifest.plist,上傳,最後上傳咱們的 down.html

而後在瀏覽器中訪問 down.html,點擊"點擊安裝"就能夠了 app

4. 主意事項

    1. 正常導出 ipa 包的時候選擇 adhoc,或者有企業開發者帳號的打企業包
    1. 重簽名的話要提早在蘋果開發者中心生成 adhoc 的配置文件,使用這個配置文件重簽名.
相關文章
相關標籤/搜索