iOS 用个人证书shell打包上传蒲公英

用个人证书Shell打包发布蒲公英。下面记录下主要步骤

1、shell脚本

#!/bin/sh

function setup_dir {
if [ -d "${BUILD_PATH}" ]; then
rm -rf "${BUILD_PATH}"
fi
mkdir -p "${BUILD_PATH}"
touch ${LOG_FILE}
}

function build_upload {
echo "----  Start building process"

# clean and archive
xcodebuild -project ${PROJECT} -scheme ${SCHEME} -configuration ${CONFIGURATION} -sdk iphoneos -xcconfig ${CONFIG_FILE} -archivePath ${ARCHIVE_FILE} clean archive >> ${LOG_FILE} 2>&1

echo "=== Archived project ${PROJECT} at ${ARCHIVE_FILE}"

# export
xcrun xcodebuild -exportArchive -exportOptionsPlist ${EXPORT_OPTIONS_FILE} -archivePath ${ARCHIVE_FILE} -exportPath ${EXPORT_PATH} >> ${LOG_FILE}


echo "IPA file size is 'du -h ${IPA_FILE} | cut -f1'" | tee -a ${LOG_FILE}

echo "=== Uploading to pgyer & fir now"

# upload to pgyer
curl -F "file=@${IPA_FILE}" -F "uKey=蒲公英的key" -F "_api_key=蒲公英的api——Key" -F "publishRange=2" http://www.pgyer.com/apiv1/app/upload >> ${LOG_FILE}
echo "upload success download 下载地址"
}

set -e


CONFIG_FILE="Scripts/ci/DeployConfig.xcconfig"
EXPORT_OPTIONS_FILE="Scripts/ci/ExportOptions.plist"


PROJECT="工程名字.xcodeproj"
SCHEME="工程名字"
CONFIGURATION="Release"
APP_NAME="工程名字"
BUILD_PATH="build/${SCHEME}"
LOG_FILE="${BUILD_PATH}/build.log"
ARCHIVE_FILE="${BUILD_PATH}/${APP_NAME}.xcarchive"
EXPORT_PATH="${BUILD_PATH}"
IPA_FILE="${EXPORT_PATH}/${APP_NAME}.ipa"



echo '--- start ---'
setup_dir
build_upload
echo '--- end ---'

DeployConfig.xcconfig

OTHER_LDFLAGS = -ObjC -all_load
ExportOptions.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>method</key>
	<string>development</string>
	<key>teamID</key>
	<string>发布证书的ID</string>
	<key>compileBitcode</key>
	<false/>
	<key>iCloudContainerEnvironment</key>
	<string>Development</string>
	<key>uploadSymbols</key>
	<false/>
	<key>uploadBitcode</key>
	<false/>
</dict>
</plist>



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

杜甲同学

感谢打赏,我会继续努力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值