xcode 命令行编译记录

打出 archive 包裹

xcodebuild -archivePath "yqmiot.xcarchive" -scheme "月球猫互联" archive

导出 ipa 包

xcodebuild -exportArchive -archivePath 月球猫互联.xcarchive -exportPath Release-iphoneos -exportOptionsPlist ExportOptions.plist

编写导出配置文档 ExportOptions.plist

ExportOptions.plist 这文档描述了导出ipa包的一些参数

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>compileBitcode</key>
    <false/>
    <key>method</key>
    <string>development</string>
    <key>provisioningProfiles</key>
    <dict>
        <key>io.yqm.debug.app</key>
        <string>1024Dev</string>
    </dict>
    <key>signingCertificate</key>
    <string>iPhone Developer</string>
    <key>signingStyle</key>
    <string>manual</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>D48G7AL347</string>
    <key>thinning</key>
    <string>&lt;none&gt;</string>
</dict>
</plist>

命令行指定TEAM,PROVISIONING

xcodebuild -archivePath “yqmiot.xcarchive” -scheme “yqmiot” archive DEVELOPMENT_TEAM=D48G7AL347 CODE_SIGN_STYLE=Manual PROVISIONING_PROFILE_SPECIFIER=1024Dev xcodebuild -archivePath “yqmiot.xcarchive” -scheme “yqmiot” archive DEVELOPMENT_TEAM=D48G7AL347 DEVELOPMENT_PROVISIONING=1024Dev

参考资料

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