自動包装のshell

2925 ワード

http://www.cocoachina.com/bbs/read.php?tid=91357&page=1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37#!/bin/sh  #  build.Script.sh#  xxxx##  Created by michael on 12-1-16.#  Copyright (c) 2012 xxxx. All rights reserved. 
  distDir="/Users/michael/Desktop/dist"releaseDir="./build/"version="1_5_0"                                                 # rm-rdf "$distDir"mkdir"$distDir"rm-rdf "$releaseDir"forline in$(catchannel)                                  # channel :  appstore:10001 { : }doipafilename=`echo$line|cut-f1 -d':'`                # sourceid=`echo$line|cut-f2 -d':'`                      # xcodebuild clean -configuration "Distribution_${ipafilename}"       #clean echo"ipafilename=$ipafilename"echo"sourceid=$sourceid"targetName="xxxx"                                       # (xcode ) 
  ipapath="${distDir}/${targetName}_${version}_for_${sourceid}.ipa"  echo"*** build app ***"xcodebuild -project xxxx.xcodeproj -target "$targetName"-configuration "Distribution_${ipafilename}"   -sdk iphoneos5.0 buildappfile="${releaseDir}Distribution_${ipafilename}-iphoneos/${targetName}.app"cd${releaseDir}Distribution_${ipafilename}-iphoneos/zip -r "${targetName}_${ipafilename}_${version}.zip""${targetName}.app"cd..cd..echo"*** ipa ****"/usr/bin/xcrun -sdk iphoneos5.0 PackageApplication -v"$appfile" -o "$ipapath"--sign "iPhone Distribution: xxxxx company"done