iOS Shell Packaging script Xcodebuild

Source: Internet
Author: User

#! /bin/Bashproject_path=$(dirname$0) Project_config=Releaseoutput_path=~/Desktopbuild_scheme=Ykticketsappworkspace_name=Ykticketsappparameter=":p: c:o:s:w:h:" whilegetopts $parameter optname Do         Case "$optname" inch            "P") Project_path=$OPTARG;; "C") Project_config=$OPTARG;; "o") Output_path=$OPTARG;; "s") Build_scheme=$OPTARG;; "W") workspace_name=$OPTARG;; "h" )                Echo "-P project path, default to the current path"                Echo "- C Fixed plate configuration name, default is release"                Echo "- o Packaging output path, default to Desktop"                Echo "- S Package usage policy, default to Ykticketsapp"                Echo "- w Package workspace name, default is Ykticketsapp"Exit -                ;; *     )                Echo "Invalid parameter"                Echo "-P project path, default to the current path"                Echo "- C Fixed plate configuration name, default is release"                Echo "- o Packaging output path, default to Desktop"                Echo "- S Package usage policy, default to Ykticketsapp"                Echo "- w Package workspace name, default is Ykticketsapp"Exit +                ;; Esac     DoneWorkspace_file="${project_path}/${workspace_name}.xcworkspace"Date_time="$ (date +"%y%m%d_%h%m%s")"Archive_file="${output_path}/${date_time}_${project_config}.xcarchive"Ipa_file="${output_path}/${date_time}_${project_config}.ipa"#cd $project _path#pod_cmd='pod update--verbose--no-repo-update'# $pod _cmd#clean_cmd="xcodebuild Clean"#clean_cmd="${clean_cmd}-workspace ${workspace_file}"#clean_cmd="${clean_cmd}-scheme ${build_scheme}"#clean_cmd="${clean_cmd}-configuration ${project_config}"#Echo${clean_cmd}# $clean _cmd#if[$?-ne 0]; Then#    Echo "The cleanup project failed, please check the project. "# Exit -#fi#xcc='/users/ykse/desktop/iphone/channelconfig/hongtan/yk_hongditan_enterprise.xcconfig'#sign='iPhone Distribution:ykse Co., Ltd.'#pf='92d73c46-f9f5-4e7f-b37c-11f933dbe395'Build_cmd="xcodebuild-workspace ${workspace_file}"Build_cmd="${build_cmd}-scheme ${build_scheme}"Build_cmd="${build_cmd}-destination Generic/platform=ios archive"Build_cmd="${build_cmd}-configuration ${project_config}"Build_cmd="${build_cmd} only_active_arch=no-archivepath ${archive_file}"#build_cmd="${build_cmd} code_sign_identity=${sign}"#build_cmd="${build_cmd} PROVISIONING_PROFILE=${PF}"Echo${build_cmd} $build _cmdif[$?-ne0]; Then    Echo "failed to build the project, please check the project. "Exit tofiRun_cmd="XCRUN-SDK Iphoneos"Run_cmd="${run_cmd} packageapplication-v"Run_cmd="${run_cmd} ${archive_file}/products/applications/ykticketsapp.app"Run_cmd="${run_cmd}-o ${ipa_file}"Echo${run_cmd} $run _cmdif[$?-ne0]; Then    Echo "The package project failed, please check the project. "Exit +fi

iOS Shell Packaging script Xcodebuild

Related Article

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.