一、打包ipa,plist
工具:xcode6
證書:企業級開發證書html
1.1)xcode6開始企業級打包時不在生成plist,須要本身編寫:模版見下:數據庫
<?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>(這裏是IPA文件的路徑, http路徑就能夠)</string>
<key>New item</key>
<string></string>
</dict>
</array>
<key>metadata</key>
<dict>
<key>bundle-identifier</key>
<string>c(這個名字在xcode 中查看)</string>
<key>bundle-version</key>
<string>1.1(app的版本,在xcode中看)</string>
<key>kind</key>
<string>software</string>
<key>title</key>
<string>(這裏是APP的名稱)</string>
</dict>
</dict>
</array>
</dict>
</plist>xcode
方案1瀏覽器
二、選擇https服務器
plist文件必須放到 https得服務器上。
這裏使用七牛的免費域名,須要去七牛的網站上註冊。
註冊地址:https://portal.qiniu.com/服務器
三、上傳ipa,plist網絡
註冊完成後,會有一個免費的http域名能夠用;
在域名設置-https 在申請一個https的域名,這裏須要提交證件照片,等待審覈,正常一天內審覈經過;app
審覈經過後,上傳plist文件和ipa文件到空間上(ipa也能夠當在其餘http的服務上)ide
在文件名右側的 倒三角能夠查看http訪問地址:例:
http://7wy3rr.com1.z0.glb.clouddn.com/****.plist工具
轉成https的訪問地址爲: https://dn-***.qbox.me/****.plist(前提是https的申請經過)網站
四、代碼處理
4.1)代碼中判斷版本是否爲最新
獲取當前版本:NSDictionary *localDic =[[NSBundle mainBundle] infoDictionary];
NSString *currVersion =[localDic objectForKey:@"CFBundleShortVersionString"];
獲取最新版本:本地數據庫保存最新版本號
4.2)更新版本
#define APP_DownloadURL @"itms-services://?action=download-manifest&url=https://dn-*****.qbox.me/gsSales.plist"
NSURL *url = [NSURL URLWithString:APP_DownloadURL];
[[UIApplication sharedApplication] openURL:url];
5)、錯誤緣由
5.1)process launch failed: timed out waiting for app to launch
一、肯定plist得外鏈是否可用,就直接把 哪一個https得外鏈 在 瀏覽器上打開,若是能夠直接現實plist裏得內容,這就能夠說明 這個連接是沒有問題得。
二、plist裏面地址配置好,上傳得網盤,生成https外鏈,而後 在蘋果手機上輸入
itms-services:///?action=download-manifest&url=https://XXXXXX.qbox.me/XXXXX.plist
把紅色部分換成你的外鏈,這樣就能夠直接下載app了,
若是第一步正確,第二步不出下載,說明是plist可能有問題
若是 出現了下載效果,但下載過程當中安裝失敗,那多是你app證書得問題。
5.2)安裝失敗
一、網絡緣由 下載ipa包時報錯 切換其餘網絡嘗試
方案2:
http://fir.im/
提供app內測服務。
參考:
http://jingyan.baidu.com/article/a3aad71aa5fbfbb1fb0096b1.html