編譯和簽署架構

在專案 MyProject for schema Qa 上清理和編譯 iPhone 的程式碼:

xcrun xcodebuild clean \
    -workspace "MyProject.xcworkspace" \
    -scheme "YourScheme" \
    -sdk iphoneos \
    -configuration Debug \
    archive \
    -archivePath builds/MyProject.xcarchive

配置可以是 DebugRelease

簽署以前編譯的程式碼:

xcrun xcodebuild -exportArchive \
    -archivePath builds/MyProject-Qa.xcarchive \
    -exportOptionsPlist config.plist \
    -exportPath builds

config.plist 包含有關如何打包和簽署應用程式的資訊,以便開發構建使用:

<?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>method</key>
        <string>development</string>
        <key>uploadSymbols</key>
        <true/>
</dict>
</plist>

App Store 釋出 plist 應包含以下內容:

<?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>teamID</key>
        <string>xxxxxxxxxxx</string>
        <key>method</key>
        <string>app-store</string>
        <key>uploadSymbols</key>
        <true/>
</dict>
</plist>

可以從你的鑰匙串獲取團隊 ID。

所有可用引數

  • compileBitcode
  • embedOnDemandResourcesAssetPacksInBundle
  • iCloudContainerEnvironment
  • manifest
  • method
  • onDemandResourcesAssetPacksBaseURL
  • teamID
  • thinning
  • uploadBitcode
  • uploadSymbols

要獲得有關每個引數的更多資訊,請執行 xcodebuild --help