美文网首页
1103-Shell

1103-Shell

作者: _健健 | 来源:发表于2015-11-05 10:28 被阅读42次

    用shell脚本解决繁琐的多渠道打包工作。

    资料:http://c.biancheng.net/cpp/view/6994.html

    代码:

    #!/bin/sh

    CONFIG_ROOT_PATH="/Users/metao/work/ios/haigou"

    cd $CONFIG_ROOT_PATH

    #循环数组

    CHANNELID=("appstore""91助手""PP助手")

    for((i=0;i<${#CHANNELID[@]};i++))

    do

    #删除

    rm -rf"/Users/metao/work/ios/haigou/build/"

    #清除

    xcodebuild -target haigou clean

    echo ${CHANNELID[$i]}

    #修改plist

    /usr/libexec/PlistBuddy -c"set :CHANNELID ${CHANNELID[$i]}"/Users/metao/work/ios/haigou/haigou/haigou-Info.plist

    #打包

    xcodebuild -target haigou -configuration Release -sdk iphoneos build

    #生成ipa

    xcrun -sdk iphoneos PackageApplication -v"/Users/metao/work/ios/haigou/build/Release-iphoneos/haigou.app"-o"/Users/metao/work/ipa/haigou_${CHANNELID[$i]}.ipa"

    done

    搞定,perfect!

    相关文章

      网友评论

          本文标题:1103-Shell

          本文链接:https://www.haomeiwen.com/subject/xrfchttx.html