天天看點

iOS: install App via OTA

下面是把app放到web site,讓其他人通過Over the Air (OTA)下載下傳安裝的步驟。

前提: 能安裝app的device需要被包含在你的provisioning profile裡

Environment: iOS 5.0 + xcode 4.3

ref link: iOS Device" in the active scheme (如果選擇的是iPad simulator or iPhone simulator,那麼menu "Product > Archive"是灰化的)

iOS: install App via OTA

Step 2 select menu "Product > Archive"來為你的project建立一個archive (it is recommended that build your project again before this action)

Step 3 這時應該會自動彈出organizer window (之後你可以通過menu "Window > Organizer"來打開它),并顯示你剛建立的archive item in the archive list。Highlight the archive item, and then click "Distribute..." button

Step 4 select option "Save for enterprise or Ad-Hoc deployment", click "Next"

Step 5 set "Code Signing Identity" as default value, my default value is "Tomson Xu" (這應該是你在apple developer site建立的certificate name), click "Next"

Step 6 設定"Save as"為你的project name,設定存放生成檔案的位置"Where",勾上"Save for Enterprise Distribution"。

Step 7 設定"Application URL"為即将生成的ipa将放到web site裡的URL (e.g.http://xxx.xxx.xxx.xxx/CityUCAP.ipa),設定"Title"為任意text(注意它并不是安裝後的app display name), click "Save" button. 這時它将建立一個ipa file和一個與ipa file同名的plist file (假設為 CityUCAP.ipa and CityUCAP.plist)

Step 8 把step 7生成的ipa and plist file複制到你的web site裡 (注意:其url要和step 7設定的”Application URL“一樣),然後建立一個html file as follow.

<a href="itms-services://?action=download-manifest&url=http://xxx.xxx.xxx.xxx/
CityUCAP.plist" target="_blank" rel="external nofollow" >Install App</a>
           

Step 9 你 需要添加2個MIME類型到你的web server,否則安裝過程中就有可能出錯。下面以IIS為例添加MIME type

1. 打開IIS Manager,左邊panel標明root node,然後在右邊的panel double click "MIME Types"

2. right click 任意位置, select "Add...",分别添加下列2個MIME Type

File name extension: .ipa 

MIME Type: application/octet-stream

File name extension: .plist 

MIME Type: text/xml

3. restart your web server

Step 10. 在你的iPhone web browser裡通路Step 8建立的html file,然後click link to install app!