用shell腳本解決繁瑣的多渠道打包工作祝旷。
資料:http://c.biancheng.net/cpp/view/6994.html
代碼:
#!/bin/sh
CONFIG_ROOT_PATH="/Users/metao/work/ios/haigou"
cd $CONFIG_ROOT_PATH
#循環(huán)數(shù)組
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嚣伐!