ios 脚本打包demo

创建一个IpaPackageTest 空的工程

#!Get the root path
rootPath=$(cd "$(dirname "$0")"; pwd)
#!xcodebuild
xcodebuildPATH=/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild
#!PackageApplication
PackageApplicationPATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/PackageApplication


#security unlock-keychain -p 000000 /Users/wwwwww/Library/Keychains/login.keychain

SDK=`xcodebuild -version -sdk iphoneos Path`

echo "sdk is $SDK"

#Clean 工程
${xcodebuildPATH} -project ${rootPath}/IpaPackageTest.xcodeproj clean

clear
${xcodebuildPATH} -project ${rootPath}/IpaPackageTest.xcodeproj -target IpaPackageTest -configuration Distribution  -sdk $SDK build

#!Archive
${PackageApplicationPATH}  -v ${rootPath}/Build/Release-iphoneos/IpaPackageTest.app -o ${rootPath}/out/test.ipa

cd ${rootPath}/out

#!zip包
zip -r ${rootPath}/out/test.zip test.ipa

//${xcodebuildPATH} -project ${rootPath}/ipabuildtest.xcodeproj  -configuration Distribution  -sdk $SDK -target  ipabuildtest

//#${PackageApplicationPATH} -v ${rootPath}/Build/Release-iphoneos/ipabuildtest.app -o ${rootPath}/out/test.ipa

//${xcodebuildPATH} -project ${rootPath}/ipabuildtest.xcodeproj clean

//${xcodebuildPATH} -project ${rootPath}/ipabuildtest.xcodeproj -configuration Distribution   -sdk $SDK -scheme  ipabuildtest archive -archivePath ${rootPath}/data/iphone.xcarchive

//cd ${rootPath} //${xcodebuildPATH} -exportArchive -archivePath ${rootPath}/data/iphone.xcarchive -exportPath ${rootPath}/out/1.ipa -exportFormat ipa -exportProvisioningProfile filename 

参考:http://blog.csdn.net/sqq521/article/details/46830201
http://mobile.51cto.com/hot-439106.htm
http://www.ithao123.cn/content-1064661.html

你可能感兴趣的:(ios)