#需要编译的 targetName
TARGET_NAME="xxxxxx"
#输出的ipa目录
IPAPATH=$HOME/Desktop/Upload_IPA/out
#ipa文件的绝对路径
IPAABSOLUTEPATH=${IPAPATH}/${TARGET_NAME}.ipa
cd $HOME/Desktop/xxxxxx //切换到xxxxxx.xcworkspace所在路径
#编译
xcodebuild archive -workspace xxxxxx.xcworkspace -scheme xxxxxx -configuration Release -archivePath ${IPAPATH}/${TARGET_NAME}.xcarchive
echo "xcodebuild archive end"
#导出
xcodebuild -exportArchive -exportOptionsPlist ExportOptions.plist -archivePath ${IPAPATH}/${TARGET_NAME}.xcarchive -exportPath ${IPAPATH}
#API Token,可用于登录 fir-cli,需要安装fir-cli,使用命令 $sudo gem install fir-cli
fir login API Token
#上传IPA到fir服务器
fir publish ${IPAABSOLUTEPATH}
上传IPA到fir.im服务器需要在终端安装命令fir-cli:
$sudo gem install fir-cli
脚本中需要修改两处
1、输出IPA的目录需要在脚本中修改
IPAPATH=$HOME/Desktop/Upload_IPA/out //这个目录是在桌面上创建了Upload_IPA文件夹,out为Upload_IPA的子文件夹
2、切换到ZGStudentServices.xcworkspace所在路径需要在脚本中修改
cd $HOME/Desktop/中公开学/ios_studentServices
常见问题:
Archive 导出 ipa 报错 IPA processing failed
原因:iOS 13取消了模拟器架构的支持,如果动态库包含 i386,x86_64架构,导出 ipa 会报IPA processing failed.
解决方式:移除x86_64、i386架构
查看动态库支持的架构
lipo -info 库文件路径
lipo -info IJKMediaFramework //打印 Architectures in the fat file: IJKMediaFramework are: x86_64 armv7 arm64
移除x86_64架构
lipo -remove i386 库文件路径 -o 输出路径
lipo -remove x86_64 库文件路径 -o 输出路径
lipo -remove x86_64 IJKMediaFramework -o IJKMediaFramework
lipo -info IJKMediaFramework //打印 Architectures in the fat file: IJKMediaFramework are: armv7 arm64
网友评论