新聞中心

EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > iOS開發(fā)包一鍵分發(fā)fir.im版,無需配置服務(wù)器,零成

iOS開發(fā)包一鍵分發(fā)fir.im版,無需配置服務(wù)器,零成

作者: 時(shí)間:2016-09-12 來源:網(wǎng)絡(luò) 收藏

很高興之前寫的iOS測試包分發(fā)又有了新版本。這版本是去除了服務(wù)器配置,直接使用http://fir.im來做文件存儲。

本文引用地址:http://butianyuan.cn/article/201609/304765.htm

相關(guān)代碼在github上也放了份,有興趣可以star下https://github.com/qdvictory/EasyToMore

xcode中添加run script,復(fù)制所有代碼。只要修改一下icon地址就可以了。

因?yàn)榻?jīng)常完善功能,代碼有所改動,建議前往github查看最新代碼

#/bin/sh

# Date: 2013-06-20

# Author: Seamus

# Sina Weibo: @qdvictory

# compress application.

if [ ${CONFIGURATION} = Debug ]; then

############################開發(fā)者配置#################################

#icon地址(相對于項(xiàng)目根目錄)

pathtoartwork=iFurniture/icon/120.png

#####################################################################

#獲取app名

ipaname=`/usr/libexec/PlistBuddy -c Print :CFBundleDisplayName $REV ${TARGET_BUILD_DIR}/${INFOPLIST_PATH}`

#獲取版本號

version=`/usr/libexec/PlistBuddy -c Print :CFBundleVersion $REV ${TARGET_BUILD_DIR}/${INFOPLIST_PATH}`

#appid

appid=`/usr/libexec/PlistBuddy -c Print :CFBundleIdentifier $REV ${TARGET_BUILD_DIR}/${INFOPLIST_PATH}`

#打包.ipa

/bin/mkdir $CONFIGURATION_BUILD_DIR/Payload

/bin/cp -R $CONFIGURATION_BUILD_DIR/${ipaname}.app $CONFIGURATION_BUILD_DIR/Payload

/bin/cp ${pathtoartwork} $CONFIGURATION_BUILD_DIR/iTunesArtwork

cd $CONFIGURATION_BUILD_DIR

# zip up the Instasoccer directory

/usr/bin/zip -r ${ipaname}.ipa Payload iTunesArtwork

#fir.im上傳第一步

d=`curl http://fir.im/api/upload_url?appid=${appid}`

#fir.im上傳第二步

postFile=`echo $3rbfx5x| ruby -e require 'rubygems'; require 'json'; puts JSON[STDIN.read]['postFile'];`

postIcon=`echo $nnlhh55| ruby -e require 'rubygems'; require 'json'; puts JSON[STDIN.read]['postIcon'];`

shorturl=`echo $3htz5j5| ruby -e require 'rubygems'; require 'json'; puts JSON[STDIN.read]['short'];`

curl -T ${ipaname}.ipa ${postFile} -X PUT

curl -T $CONFIGURATION_BUILD_DIR/iTunesArtwork ${postIcon} -X PUT

#fir.im上傳第三步

postData='appid='${appid}'short='${shorturl}'version='${version}'name='${ipaname}

r=`curl -X POST -d ${postData} -H Content-Type: application/x-www-form-urlencoded; charset=utf-8 http://fir.im/api/finish`

short=`echo ${r}| ruby -e require 'rubygems'; require 'json'; puts JSON[STDIN.read]['short'];`

#輸出url

`osascript -e 'tell app System Events to (display dialog 恭喜您,IPA上傳完成。復(fù)制地址即可下載。nhttp://fir.im/'${short}' with title IPA一鍵分享 buttons {ok})'`

#刪除臨時(shí)文件

rm -R $CONFIGURATION_BUILD_DIR/Payload

rm ${ipaname}.ipa

fi

exit 0

配置完成后,編譯,OK。



關(guān)鍵詞:

評論


相關(guān)推薦

技術(shù)專區(qū)

關(guān)閉