自动打渠道包的shell命令

如题,现在的商业项目,特别是要在国内推广的,难免要和一些渠道商合作,这就需要我们攻城师为指定的渠道打特定的包。

 

以前我都是手动改build configureation,生成不同的包。

 

后来觉得麻烦 ,在网上学习了一下,弄了这个东西,大家看看,拿去修改修改就能用了。

1    #!/bin/sh

3    #  build.Script.sh
4    #  xxxx
5    #
6    #  Created by michael on 12-1-16.
7    #  Copyright (c) 2012年 xxxx. All rights reserved.
8   
9  
10  distDir="/Users/michael/Desktop/dist"
11  releaseDir="./build/"
12  version="1_5_0"                                                 #发布的版本号
13  rm -rdf "$distDir"
14  mkdir "$distDir"
15  rm -rdf "$releaseDir"
16  for line in $(cat channel)                                  #读取所有渠道号channel文件 如:  appstore:10001 {渠道名:渠道号}
17  do
18  ipafilename=`echo $line|cut -f1 -d':'`                 #渠道名
19  sourceid=`echo $line|cut -f2 -d':'`                      #渠道号
20  xcodebuild clean -configuration "Distribution_${ipafilename}"      #clean项目
21  echo "ipafilename=$ipafilename"
22  echo "sourceid=$sourceid"
23  targetName="xxxx"                                       #项目名称(xcode左边列表中显示的项目名称)
24 
25 
26  ipapath="${distDir}/${targetName}_${version}_for_${sourceid}.ipa"
27 
28  echo "***开始build app文件***"
29  xcodebuild -project xxxx.xcodeproj -target "$targetName" -configuration "Distribution_${ipafilename}"  -sdk   iphoneos5.0 build
30appfile="${releaseDir}Distribution_${ipafilename}-iphoneos/${targetName}.app"
31  cd ${releaseDir}Distribution_${ipafilename}-iphoneos/
32  zip -r "${targetName}_${ipafilename}_${version}.zip" "${targetName}.app"
33  cd ..
34  cd ..
35  echo "***开始打ipa渠道包****"
36  /usr/bin/xcrun -sdk iphoneos5.0 PackageApplication -v "$appfile" -o "$ipapath" --sign "iPhone Distribution: xxxxx company"
37  done


(转:http://www.cocoachina.com/macdev/tips/2013/0222/5704.html)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值