IOS使用批處理打包

來源:互聯網
上載者:User

標籤:讀取   clean   gets   www.   參數   csdn   car   方式   變數   

  之前咱們講過 使用命令列打包 下面咱們介紹使用指令碼打包,其實指令碼和命令列沒有太大的本質區別。

   以下是指令檔:

#注意:指令碼目錄和xxxx.xcodeproj要在同一個目錄,如果放到其他目錄,請自行修改指令碼。#工程名字(Target名字)Project_Name="Target名字,系統預設和工程名字一樣"#配置環境,Release或者DebugConfiguration="Release"#AdHoc版本的Bundle IDAdHocBundleID="com.xxxxx"#AppStore版本的Bundle IDAppStoreBundleID="com.xxxxx"#enterprise的Bundle IDEnterpriseBundleID="com.xxxxx"# ADHOC#認證名#描述檔案ADHOCCODE_SIGN_IDENTITY="iPhone Distribution: xxxxx"ADHOCPROVISIONING_PROFILE_NAME="xxxxx-xxxx-xxxxx-xxxxx"#AppStore認證名#描述檔案APPSTORECODE_SIGN_IDENTITY="iPhone Distribution: xxxx"APPSTOREROVISIONING_PROFILE_NAME="xxxx-xxxx-xxxx-xxxx-xxxx"#企業(enterprise)認證名#描述檔案ENTERPRISECODE_SIGN_IDENTITY="iPhone Distribution: xxxx"ENTERPRISEROVISIONING_PROFILE_NAME="693bc1e0-7f7a-4fba-8a08-977ffb7fb296"#載入各個版本的plist檔案ADHOCExportOptionsPlist=./ADHOCExportOptionsPlist.plistAppStoreExportOptionsPlist=./AppStoreExportOptionsPlist.plistEnterpriseExportOptionsPlist=./EnterpriseExportOptionsPlist.plistADHOCExportOptionsPlist=${ADHOCExportOptionsPlist}AppStoreExportOptionsPlist=${AppStoreExportOptionsPlist}EnterpriseExportOptionsPlist=${EnterpriseExportOptionsPlist}echo "~~~~~~~~~~~~選擇打包方式(輸入序號)~~~~~~~~~~~~~~~"echo "1 appstore"echo "2 adhoc"echo "3 enterprise"# 讀取使用者輸入並存到變數裡read parametersleep 0.5method="$parameter"# 判讀使用者是否有輸入if [ -n "$method" ]then#clean下xcodebuild clean -xcodeproj ./$Project_Name/$Project_Name.xcodeproj -configuration $Configuration -alltargets    if [ "$method" = "1" ]    then#appstore指令碼xcodebuild -project $Project_Name.xcodeproj -scheme $Project_Name -configuration $Configuration -archivePath build/$Project_Name-appstore.xcarchive clean archive build  CODE_SIGN_IDENTITY="${APPSTORECODE_SIGN_IDENTITY}" PROVISIONING_PROFILE="${APPSTOREROVISIONING_PROFILE_NAME}" PRODUCT_BUNDLE_IDENTIFIER="${AppStoreBundleID}"xcodebuild -exportArchive -archivePath build/$Project_Name-appstore.xcarchive -exportOptionsPlist $AppStoreExportOptionsPlist -exportPath ~/Desktop/$Project_Name-appstore.ipa    elif [ "$method" = "2" ]    then#adhoc指令碼xcodebuild -project $Project_Name.xcodeproj -scheme $Project_Name -configuration $Configuration -archivePath build/$Project_Name-adhoc.xcarchive clean archive build CODE_SIGN_IDENTITY="${ADHOCCODE_SIGN_IDENTITY}" PROVISIONING_PROFILE="${ADHOCPROVISIONING_PROFILE_NAME}" PRODUCT_BUNDLE_IDENTIFIER="${AdHocBundleID}"xcodebuild -exportArchive -archivePath build/$Project_Name-adhoc.xcarchive -exportOptionsPlist $ADHOCExportOptionsPlist -exportPath ~/Desktop/$Project_Name-adhoc.ipa    elif [ "$method" = "3" ]    then#企業打包指令碼xcodebuild -project $Project_Name.xcodeproj -scheme $Project_Name -configuration $Configuration -archivePath build/$Project_Name-enterprise.xcarchive clean archive build CODE_SIGN_IDENTITY="${ENTERPRISECODE_SIGN_IDENTITY}" PROVISIONING_PROFILE="${ENTERPRISEROVISIONING_PROFILE_NAME}" PRODUCT_BUNDLE_IDENTIFIER="${EnterpriseBundleID}"xcodebuild -exportArchive -archivePath build/$Project_Name-enterprise.xcarchive -exportOptionsPlist $EnterpriseExportOptionsPlist -exportPath ~/Desktop/$Project_Name-enterprise.ipaelse    echo "參數無效...."    exit 1    fifi
其中AppStore認證名、描述檔案參考 認證(Certificate)與描述檔案(Provisioning Profiles)




參考文檔
  54144149

IOS使用批處理打包

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.