#!/bin/bash
# 1、提前把項(xiàng)目git到本地 $git clone 項(xiàng)目git地址? 2试吁、進(jìn)入項(xiàng)目根目錄然后切換到當(dāng)前開發(fā)分支 $git checkout 當(dāng)期分支名
cd 項(xiàng)目路徑? #進(jìn)入項(xiàng)目路徑
git pull? #拉取更新
project_name="項(xiàng)目名稱"
xcodebuild archive -workspace $project_name.xcworkspace -scheme $project_name -configuration"Debug"-archivePath ./$project_name.xcarchive
#-archivePath? ? archive路徑。默認(rèn)即可
xcodebuild -exportArchive -archivePath ./$project_name.xcarchive -exportOptionsPlist /Users/.../ExportOptions.plist? -exportPath /Users/.../SVN_ipa??
#-exportOptionsPlist 打包配置文件败晴。可以自己手動(dòng)archive一次欧穴。 從打包出來(lái)的文件夾中拷貝ExportOptions.plist
#-exportPath? ipa包導(dǎo)出路徑
DATE=$(date +%Y%m%d_%H%M%S)
cp /Users.../項(xiàng)目名稱.ipa /Users/.../$DATE.ipa? #此處復(fù)制ipa文件到svn本地包文件下
cd /Users/.../2.0.2??
#DATE當(dāng)前時(shí)間作為包名 上傳svn
svn cleanup
svn update? --username 用戶名 --password 密碼
svn add $DATE.ipa? --username 用戶名 --password 密碼
svn commit -m"#0000 ipa commit"? --username 用戶名 --password 密碼