jenkins ios 自动打包
程序员文章站
2024-03-23 20:08:58
...
1、主要配置如图
脚本:
#!/bin/bash
# 根据实际情况修改target和scheme名字
TARGET_NAME=${BUILD_NUMBER}
SCHEME_NAME="your scheme"
XCARCHIVE_NAME="your scarchive name"
# keychainPath="/Users/yourName/Library/Keychains/login.keychain"
#获取钥匙串和打包电脑密码
security unlock-keychain -p your-secret-key ${KEYCHAIN_PATH}
# clean
xcodebuild clean -target ${TARGET_NAME}.ipa -scheme ${SCHEME_NAME} -configuration Release
# build xcarchive
xcodebuild -workspace ${WORKSPACE}/${SCHEME_NAME}.xcworkspace -archivePath ${WORKSPACE}/${XCARCHIVE_NAME}.xcarchive -scheme ${SCHEME_NAME} -sdk iphoneos -configuration Release archive
# ipa
xcodebuild -exportArchive -exportOptionsPlist ${WORKSPACE}/exportPlist.plist -archivePath ${WORKSPACE}/${XCARCHIVE_NAME}.xcarchive -exportPath ${WORKSPACE}/${TARGET_NAME}.ipa -allowProvisioningUpdates
2、这样配置的原因
因为使用jenkins xcode插件时,一直出现"your session is expired",以为这种情况就不能使用此插件了。后换成了脚本...结果还是有上述报错。。
在/usr/local/Cellar/jenkins/2.124/homebrew.mxcl.jenkins.plist文件里添加上JENKINS_UER=root后,重启jenkins。。
此后,证书也认到了,session的问题也解决了。。