ipa 自动打包脚本

#!/bin/sh

xcodePath=$1
projectPath=$2

archivePath="build/Unity-iPhone.xcarchive"
exportPath=$3 #Unity-iPhone.ipa
provisioningProfile=$4 #iOS_Distribution

ipaDir=${exportPath%/*}

mkdir $ipaDir

cd $projectPath

${xcodePath}/Contents/Developer/usr/bin/xcodebuild -scheme Unity-iPhone clean archive -archivePath $archivePath

# ${xcodePath}/Contents/Developer/usr/bin/xcodebuild -exportArchive -exportFormat ipa -archivePath $archivePath -exportPath $exportPath -exportProvisioningProfile "$provisioningProfile"
${xcodePath}/Contents/Developer/usr/bin/xcodebuild -exportArchive -archivePath $archivePath -exportPath $ipaDir -exportOptionsPlist exportOptions.plist
mv $ipaDir/Unity-iPhone.ipa $exportPath

# ${xcodePath}/Contents/Developer/usr/bin/xcodebuild build

# cd ${projectPath}/build/Release-iphoneos/

# ${xcodePath}/Contents/Developer/usr/bin/xcrun -sdk iphoneos packageapplication -v *.app -o $exportPath

exit $?

其中 exportOptions.plist

<!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>app-store</string>
    <key>teamID</key>
    <string>xxxxxxxxxx</string>
    <key>compileBitcode</key>
    <false/>
    <key>uploadSymbols</key>
    <false/>
</dict>
</plist>

method: (String) The method of distribution, which can be set as any of the following:
app-store
enterprise
ad-hoc
development
teamID: (String) The development program team identifier.
uploadSymbols: (Boolean) Option to include symbols in the generated ipa file.
uploadBitcode: (Boolean) Option to include Bitcode.

注意:teamID是十位字符串,企业包需要移除。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容