1. 工程设置为手动签名
2. plist 中添加:
provisioningProfiles Dictionary
$buildleID String profile name
method String $method
其中:$buildleID 为app Bundle Identifier
$method 包含四种,app-store, ad-hoc, enterprise, development
3. 执行命令
xcodebuild archive -project ${OUTPUT_NAME}.xcodeproj -scheme ${OUTPUT_NAME} -configuration Release CODE_SIGN_IDENTITY="$CodeSign" PROVISIONING_PROFILE="$ProvisionProfile" -archivePath archive/${OUTPUT_NAME}.xcarchive
xcodebuild -exportArchive -archivePath archive/${OUTPUT_NAME}.xcarchive -exportPath ${BUILD_DIST} -exportOptionsPlist ${OUTPUT_NAME}/Info.plist
注:${OUTPUT_NAME} 工程名称
${BUILD_DIST} 导出ipa 路径
$CodeSign 签名证书名称 ,例如:iPhone Distribution:xxx
$ProvisionProfile profile名称, uuid格式,例如:f12345678-0000-2222-3333-123456789012
2. plist 中添加:
provisioningProfiles Dictionary
$buildleID String profile name
method String $method
其中:$buildleID 为app Bundle Identifier
$method 包含四种,app-store, ad-hoc, enterprise, development
3. 执行命令
xcodebuild archive -project ${OUTPUT_NAME}.xcodeproj -scheme ${OUTPUT_NAME} -configuration Release CODE_SIGN_IDENTITY="$CodeSign" PROVISIONING_PROFILE="$ProvisionProfile" -archivePath archive/${OUTPUT_NAME}.xcarchive
xcodebuild -exportArchive -archivePath archive/${OUTPUT_NAME}.xcarchive -exportPath ${BUILD_DIST} -exportOptionsPlist ${OUTPUT_NAME}/Info.plist
注:${OUTPUT_NAME} 工程名称
${BUILD_DIST} 导出ipa 路径
$CodeSign 签名证书名称 ,例如:iPhone Distribution:xxx
$ProvisionProfile profile名称, uuid格式,例如:f12345678-0000-2222-3333-123456789012