新聞中心

        EEPW首頁 > 嵌入式系統 > 設計應用 > iOS開發包一鍵分發fir.im版,無需配置服務器,零成本

        iOS開發包一鍵分發fir.im版,無需配置服務器,零成本

        作者: 時間:2018-09-04 來源:網絡 收藏

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

        本文引用地址:http://www.104case.com/article/201809/388330.htm

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

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

        因為經常完善功能,代碼有所改動,建議前往github查看最新代碼

        #/bin/sh

        # Date: 2013-06-20

        # Author: Seamus

        # Sina Weibo: @qdvictory

        # compress application.

        if [ ${CONFIGURATION} = Debug ]; then

        ############################開發者配置#################################

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

        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 $1xhvv99hnvjz| ruby -e require 'rubygems'; require 'json'; puts  JSON[STDIN.read]['postFile'];`

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

        shorturl=`echo $1xhvv99hnvjz| 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上傳完成。復制地址即可下載。nhttp://fir.im/'${short}' with title IPA一鍵分享 buttons  {ok})'`

        #刪除臨時文件

        rm -R $CONFIGURATION_BUILD_DIR/Payload

        rm ${ipaname}.ipa

        fi

        exit 0

        配置完成后,編譯,OK。



        關鍵詞:

        評論


        相關推薦

        技術專區

        關閉
        主站蜘蛛池模板: 湘乡市| 延吉市| 阿坝| 霍邱县| 枝江市| 和林格尔县| 新平| 古蔺县| 同江市| 沅江市| 比如县| 大埔区| 乡宁县| 金乡县| 方城县| 滨州市| 恭城| 延庆县| 横山县| 陆良县| 海南省| 潮安县| 中牟县| 靖江市| 奈曼旗| 彭阳县| 平乐县| 静乐县| 峨眉山市| 正阳县| 宣武区| 天门市| 邢台县| 广饶县| 英超| 当阳市| 旺苍县| 喀什市| 凌海市| 镇雄县| 洛南县|