Xcodebuild ipa shell

命令行下打包iOS App工程:

#!/bin/sh

# How To Build ?

#http://www.jianshu.com/p/3f43370437d2

#http://www.jianshu.com/p/bd4c22952e01

#http://www.jianshu.com/p/4b0958a60905 

# ---------------------------------------------------------------------------

rm -rf ~/Desktop/Demo.ipa

xcodebuild clean

xcodebuild archive -scheme "Unity-iPhone" -configuration "Release" -archivePath "~/Desktop/Demo.xcarchive" CODE_SIGN_IDENTITY="iPhone Distribution: xxxxxxxx" PROVISIONING_PROFILE="Profile Name"

xcodebuild -exportArchive -archivePath "~/Desktop/Demo.xcarchive" -exportPath "~/Desktop/Demo.ipa" -exportOptionsPlist "exprotOptionsPlist.plist" CODE_SIGN_IDENTITY="iPhone Distribution: xxxxxxxx" PROVISIONING_PROFILE="Profile Name"

 rm -rf ~/Desktop/Demo.xcarchive

关于exportOptionsPlist(该plist文件放到和shell脚本同级目录下即可,注意method的类型,下图为企业级证书签名包配置)

原文地址:https://www.cnblogs.com/sytfyf/p/7249956.html