iOS uses batch processing to package

Source: Internet
Author: User

We talked about it before. Use the command line package here we introduce the use of script packaging, in fact, the script and the command line is not much of the essential difference.

Here is the script file:

#注意: The script directory and xxxx.xcodeproj are in the same directory, and if you put it in a different directory, modify the script yourself. #工程名字 (target name) project_name= "target name, system default and project name" #配置环境, release or debugconfiguration= "release" #AdHoc版本的Bundle Idadhocbundleid= "com.xxxxx" #AppStore版本的Bundle idappstorebundleid= "com.xxxxx" #enterprise的Bundle Identerprisebundleid= "com.xxxxx" # adhoc# certificate Name # Profile adhoccode_sign_identity= "IPhone distribution:xxxxx" Adhocprovisioning_profile_name= "xxxxx-xxxx-xxxxx-xxxxx" #AppStore证书名 # profile Appstorecode_sign_identity= "IPhone Distribution:xxxx "Appstorerovisioning_profile_name=" Xxxx-xxxx-xxxx-xxxx-xxxx "#企业 (Enterprise) certificate name # Description file 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 "~~~~~~~~~~~~ Select Packaging Method (input serial number) ~~~~~~~~~~~~~~~" echo "1 AppStore "Echo" 2 Adhoc "echo" 3 Enterprise "# Read user input coexist in variable read parametersleep 0.5method=" $parameter "# to interpret if the user has input if [-N ' $method"]th En#clean xcodebuild clean-xcodeproj./$Project _name/$Project _name.xcodeproj-configuration $Configuration- Alltargets if ["$method" = "1"] Then#appstore script 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 script 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"] t hen# Enterprise Packaging script 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 "parameter is invalid ...."    Exit 1 Fifi 
where AppStore certificate name, description file Reference certificate (Certificate) and description file (Provisioning Profiles)




Reference documents
54144149

iOS uses batch processing to package

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.