首页 > 代码库 > xcodebuild编译ipa
xcodebuild编译ipa
#!/bin/sh# autoBuild.sh# CTest## Created by Ethan on 14-11-3.# Copyright (c) 2014年 Ethan. All rights reserved.################################################使用方法#./build.sh arg1 arg2 arg3 arg4#arg1 项目的路径,例如:/Volumes/work/buildCommand/test/CTest#arg2 为项目编译ID#arg3 为编译完成回调地址#arg4 公司项目特殊用法#服务器需要修改源###############################################################################################回调函数function fCallBack(){ echo $1 #1/-1 echo $2 #buildID echo $3 #http://www.baidu.com#echo ${logPath}# echo ${ipaPath} url="${3}?status=${1}&buildId=${2}&logger=${logPath}&package=${ipaPath}"#echo $url curl $url}################################################参数检查if [ -z "$1" ]; thenecho "error:项目路径为空"exit 1fiif [ -z "$2" ]; thenecho "error:项目编译ID为空"exit 1fiif [ -z "$3" ]; thenecho "error:回调地址为空"exit 1fiif [ -z "$4" ]; thenecho "error:证书编号为空"exit 1fi#日志地址logPath="${1}/log.txt"#ipa地址ipaPath="${1}/${2}.ipa"###############################################证书检查PROFILE_FILE="/Volumes/${4}.mobileprovision"echo $PROFILE_FILEUUID=`/usr/libexec/PlistBuddy -c ‘Print :UUID‘ /dev/stdin <<< $(security cms -D -i ${PROFILE_FILE} )`if [ -z "$UUID" ]; thenecho "error:找不到证书"exit 1fiecho $UUIDcp ${PROFILE_FILE} "$HOME/Library/MobileDevice/Provisioning Profiles/${UUID}.mobileprovision"################################################清理项目cd $1xcodebuild clean################################################编译并将日志写到文件 正式使用需要修改PROVISIONING_PROFILExcodebuild -sdk iphoneos PROVISIONING_PROFILE=${UUID} > ${logPath}#判断是否编译成功if [[ $? -eq 0 ]]; then echo "build success"else echo "build error" fCallBack "-1" $2 $3 exit 2fi################################################生成ipaxcrun -sdk iphoneos PackageApplication -v ./build/Release-iphoneos/*.app -o ${ipaPath}if [[ $? -eq 0 ]]; thenrm -rf buildecho "create ipa success"fCallBack "1" $2 $3exit 0elseecho "create ipa error"fCallBack "-1" $2 $3exit 2fi
xcodebuild编译ipa
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。