你好,歡迎來到IOS教程網

 Ios教程網 >> IOS訊息 >> 關於IOS >> iOS測試包自動分發,一鍵安裝,效率提高百分百

iOS測試包自動分發,一鍵安裝,效率提高百分百

編輯:關於IOS

一個可以讓你快速、方便、一次配置,終生受益的測試包分發教程。你還在傻傻的用airdrop,qq麼?

使用環境:

適合iOS開發者,常需要發布測試包給各類人員,那麼以後再也無需多余操作,一鍵搞定。公司有內網服務器,或用Mac os的同學都可以使用。非越獄手機可以使用,只要正常綁定過證書就沒有問題。

以下是教程,相當簡單。
服務器ip以192.168.1.188為例,端口8080

第一步,配置run script打包ipa並完成ipa上傳部署過程,Xcode中打開target->build phases->add build phase->add run script如圖添加如下代碼,並根據自己使用環境做一下調整。
iOS測試包自動分發,一鍵安裝,效率提高百分百

# shell script goes here

# compress application.
if [ "${CONFIGURATION}" = "ad_hoc" ]; then #判斷發布版本

/bin/mkdir $CONFIGURATION_BUILD_DIR/Payload

/bin/cp -R $CONFIGURATION_BUILD_DIR/InstaSoccer.app $CONFIGURATION_BUILD_DIR/Payload

/bin/cp isoccer/icon/iTunesArtwork $CONFIGURATION_BUILD_DIR/iTunesArtwork

cd $CONFIGURATION_BUILD_DIR

# zip up the Instasoccer directory

/usr/bin/zip -r InstaSoccer.ipa Payload iTunesArtwork

/usr/bin/scp InstaSoccer.ipa [email protected]:~/ipa_publish/ #scp到服務器路徑,如果用Mac本機開啟服務器,可以用cp到webserver路徑
fi
exit 0

第二步,部署服務器。可以用Mac os的Web共享,也可以自己用python開一個,當然也可以用內網服務器、外網服務器,要求極低,扔幾個靜態文件就可以。
關於Mac os 10.8在偏好設置裡面已經沒有了Web共享,要開啟的話需要手動寫一下配置文件,方法請自搜。
樣例下載
樣例中有2個文件,index.html和Info.plist
index.html修改一處,“http://192.168.1.188:8080/Info.plist” 改為你相應的路徑

<html>
<head>
<meta charset="utf-8" />
<title>Minroad一鍵安裝</title>
</head>
<a style="font-size: 5em;" href="itms-services://?action=download-manifest&url=http://192.168.1.188:8080/Info.plist">install</a>
<html>

Info.plist,修改ipa路徑(如果你用scp的話請查看你scp後的路徑是否與之相同),icon,版本號,bundle id,程序名

<?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>http://192.168.1.188:8080/InstaSoccer.ipa</string>
                                </dict>
                                <dict>
                                        <key>kind</key>
                                        <string>display-image</string>
                                        <key>needs-shine</key>
                                        <true/>
                                        <key>url</key>
                                        <string>http://192.168.1.188:8080/Icon.png</string>
                                </dict>
                                <dict>
                                        <key>kind</key>
                                        <string>full-size-image</string>
                                        <key>needs-shine</key>
                                        <true/>
                                        <key>url</key>
                                        <string>http://192.168.1.188:8080/Icon.png</string>
                                </dict>
                        </array>
                        <key>metadata</key>
                        <dict>
                                <key>bundle-identifier</key>
                                <string>com.minroad.appid</string>
                                <key>bundle-version</key>
                                <string>2.8.2</string>
                                <key>kind</key>
                                <string>software</string>
                                <key>subtitle</key>
                                <string>一鍵安裝副標題</string>
                                <key>title</key>
                                <string>一鍵安裝程序名</string>
                        </dict>
                </dict>
        </array>
</dict>
</plist>

然後在啟動webserver, 方法多了去了,提供一個python的,Mac os也可以用

cd 到當前目錄
nohup python -m SimpleHTTPServer 8080 > /dev/null 2>&1 &

此時,用你的ios設置訪問網址,本例中是http://192.168.1.188:8080,會出現如下內容
iOS測試包自動分發,一鍵安裝,效率提高百分百

iOS測試包自動分發,一鍵安裝,效率提高百分百

點擊安裝就自動安裝了。省心省力!只要將網址收藏,以後分發的事與開發人員就無關咯

  1. 上一頁:
  2. 下一頁:
蘋果刷機越獄教程| IOS教程問題解答| IOS技巧綜合| IOS7技巧| IOS8教程
Copyright © Ios教程網 All Rights Reserved