LoginSignup
2
3

More than 5 years have passed since last update.

xcodebuildでExportしたIPAをApp Store Connectにアップロードする

Posted at

Xcode10では、xcodebuildコマンドでエクスポートしたIPAをApp Store Connectに直接アップロードできます。

エクスポート用のplistを準備する

エクスポート時の設定を.plistに書き出しておけば、xcodebuildの実行時に読み込めます。

xcodebuild -helpを実行すれば、Available keys for -exportOptionsPlist:以下で設定可能な項目・値を確認できます。

今回はApp Store Connectにアップロードするだけの設定を準備します。

exportOption.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>teamID</key>
        <string>YOUR_TEAM_ID</string>
        <key>method</key>
        <string>app-store</string>
        <key>destination</key>
        <string>upload</string>
    </dict>
</plist>

.archiveの作成とエクスポートの実行

exportOption.plistの作成が終わったら、xcodebuildで.archiveを作成してエクスポートしましょう。

.archiveの作成とexportの実行
$ xcodebuild -project YOUR_PROJECT.xcodeproj -scheme YOUR_SCHEME -configuration YOUR_CONFIGURATION archive -archivePath PATH_TO_ARCHIVE_FILE
note: Using new build system
2018-11-21 13:38:09.157 xcodebuild[11213:208140]  DTDeviceKit: deviceType from a36e24c26102017fd3d4ef01600f87d5659c1866 was NULL
2018-11-21 13:38:09.178 xcodebuild[11213:208133]  DTDeviceKit: deviceType from 0f40ac13860c8fd55912060619991b13575f2615 was NULL
2018-11-21 13:38:09.188 xcodebuild[11213:208179]  DTDeviceKit: deviceType from 7a8a7db4a9c163c0d5a13d2a6d978ff115c2f233 was NULL
note: Planning build
note: Constructing build description

// 中略

** ARCHIVE SUCCEEDED **

$ xcodebuild -exportArchive -archivePath PATH_TO_ARCHIVE_FILE -exportPath PATH_TO_EXPORT_DIR -exportOptionsPlist exportOption.plist -allowProvisioningUpdates
2018-11-21 14:26:44.527 xcodebuild[27596:282693] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path ''.
2018-11-21 14:27:56.959 xcodebuild[27596:282871] Starting upload
2018-11-21 14:27:57.064 xcodebuild[27596:282871] Progress 2%: Extracting archive...
2018-11-21 14:28:00.832 xcodebuild[27596:282871] Progress 4%: Creating App Store Connect API analysis file…

/// 中略

Uploaded HOGE
** EXPORT SUCCEEDED **
2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3