编译和签署架构

在项目 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