iOS開(kāi)發(fā)包一鍵分發(fā)fir.im版,無(wú)需配置服務(wù)器,零成本
很高興之前寫(xiě)的iOS測(cè)試包分發(fā)又有了新版本。這版本是去除了服務(wù)器配置,直接使用http://fir.im來(lái)做文件存儲(chǔ)。
本文引用地址:http://cafeforensic.com/article/201809/388330.htm相關(guān)代碼在github上也放了份,有興趣可以star下https://github.com/qdvictory/EasyToMore
xcode中添加run script,復(fù)制所有代碼。只要修改一下icon地址就可以了。
因?yàn)榻?jīng)常完善功能,代碼有所改動(dòng),建議前往github查看最新代碼
#/bin/sh
# Date: 2013-06-20
# Author: Seamus
# Sina Weibo: @qdvictory
# compress application.
if [ ${CONFIGURATION} = Debug ]; then
############################開(kāi)發(fā)者配置#################################
#icon地址(相對(duì)于項(xiàng)目根目錄)
pathtoartwork=iFurniture/icon/120.png
#####################################################################
#獲取app名
ipaname=`/usr/libexec/PlistBuddy -c Print :CFBundleDisplayName $REV ${TARGET_BUILD_DIR}/${INFOPLIST_PATH}`
#獲取版本號(hào)
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 $seomo88| ruby -e require 'rubygems'; require 'json'; puts JSON[STDIN.read]['postFile'];`
postIcon=`echo $e0ku8cu| ruby -e require 'rubygems'; require 'json'; puts JSON[STDIN.read]['postIcon'];`
shorturl=`echo $2kcykqq| 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。
評(píng)論