$npx -y skills add rorkai/app-store-connect-cli-skills --skill asc-xcode-buildBuild, archive, generate export options, export, upload, and manage Xcode version/build numbers with the current asc xcode helpers before App Store Connect upload or submission. Use when creating an IPA or PKG for upload.
| 1 | # Xcode build and export |
| 2 | |
| 3 | Use this skill when you need to build an app from source and prepare it for App Store Connect. Prefer `asc xcode archive` and `asc xcode export` over raw `xcodebuild` recipes when they fit the project. |
| 4 | |
| 5 | ## Preconditions |
| 6 | |
| 7 | - Xcode and command line tools are installed. |
| 8 | - Signing identity and provisioning profiles are available, or automatic signing is enabled. |
| 9 | - App Store Connect auth is configured when upload or build lookup is needed. |
| 10 | |
| 11 | ## Manage version and build numbers |
| 12 | |
| 13 | ```bash |
| 14 | asc xcode version view |
| 15 | asc xcode version edit --version "1.3.0" --build-number "42" |
| 16 | asc xcode version edit --next-build-number --app "APP_ID" --platform IOS |
| 17 | asc xcode version bump --type build |
| 18 | asc xcode version bump --type patch |
| 19 | asc xcode version bump --type build --next-build-number --app "APP_ID" --platform IOS |
| 20 | ``` |
| 21 | |
| 22 | Use `--project-dir "./MyApp"` when not running from the project root. Use `--project "./MyApp/App.xcodeproj"` when the directory contains multiple projects. Use `--target "App"` and `--configuration "Release"` for deterministic reads and writes in multi-target or multi-configuration projects. |
| 23 | |
| 24 | To avoid low build-number rejects, resolve and apply the remote-safe build number in one command: |
| 25 | |
| 26 | ```bash |
| 27 | asc xcode version edit --next-build-number --app "APP_ID" --platform IOS --output json |
| 28 | ``` |
| 29 | |
| 30 | Version mutations validate the full change before writing and return structured output identifying the configurations and files changed. The editor follows recursive xcconfig includes and preserves unrelated project and xcconfig content. Use `asc builds next-build-number` separately when you only want to inspect the remote-safe value without changing the project. |
| 31 | |
| 32 | ## Preferred iOS/tvOS/visionOS build flow |
| 33 | |
| 34 | ### 1. Archive with asc |
| 35 | |
| 36 | ```bash |
| 37 | asc xcode archive \ |
| 38 | --workspace "App.xcworkspace" \ |
| 39 | --scheme "App" \ |
| 40 | --configuration Release \ |
| 41 | --clean \ |
| 42 | --archive-path ".asc/artifacts/App.xcarchive" \ |
| 43 | --xcodebuild-flag=-destination \ |
| 44 | --xcodebuild-flag=generic/platform=iOS \ |
| 45 | --output json |
| 46 | ``` |
| 47 | |
| 48 | Use `--project "App.xcodeproj"` instead of `--workspace` for project-only apps. |
| 49 | |
| 50 | ### 2. Export with asc |
| 51 | |
| 52 | By default, `asc xcode export` generates App Store Connect export options with automatic signing. It uses a local export destination unless `--wait` is set, in which case it uses direct upload: |
| 53 | |
| 54 | ```bash |
| 55 | asc xcode export \ |
| 56 | --archive-path ".asc/artifacts/App.xcarchive" \ |
| 57 | --ipa-path ".asc/artifacts/App.ipa" \ |
| 58 | --xcodebuild-flag=-allowProvisioningUpdates \ |
| 59 | --output json |
| 60 | ``` |
| 61 | |
| 62 | Generate a plist separately when it needs review, reuse, or manual signing: |
| 63 | |
| 64 | ```bash |
| 65 | asc xcode export-options generate \ |
| 66 | --archive-path ".asc/artifacts/App.xcarchive" \ |
| 67 | --output-path ".asc/ExportOptions.plist" \ |
| 68 | --output json |
| 69 | ``` |
| 70 | |
| 71 | For manual signing, add `--signing-style manual` and optionally `--team-id "TEAM_ID"`. Existing files require `--overwrite`. |
| 72 | |
| 73 | To upload directly through Xcode and wait for App Store Connect processing, omit `--export-options` and add `--wait`: |
| 74 | |
| 75 | ```bash |
| 76 | asc xcode export \ |
| 77 | --archive-path ".asc/artifacts/App.xcarchive" \ |
| 78 | --ipa-path ".asc/artifacts/App.ipa" \ |
| 79 | --wait \ |
| 80 | --output json |
| 81 | ``` |
| 82 | |
| 83 | ### 3. Upload or publish |
| 84 | |
| 85 | Upload an exported IPA: |
| 86 | |
| 87 | ```bash |
| 88 | asc builds upload --app "APP_ID" --ipa ".asc/artifacts/App.ipa" --wait |
| 89 | ``` |
| 90 | |
| 91 | Distribute to TestFlight: |
| 92 | |
| 93 | ```bash |
| 94 | asc publish testflight --app "APP_ID" --ipa ".asc/artifacts/App.ipa" --group "GROUP_ID" --wait |
| 95 | ``` |
| 96 | |
| 97 | Publish to the App Store: |
| 98 | |
| 99 | ```bash |
| 100 | asc publish appstore --app "APP_ID" --ipa ".asc/artifacts/App.ipa" --version "1.2.3" --wait |
| 101 | asc publish appstore --app "APP_ID" --ipa ".asc/artifacts/App.ipa" --version "1.2.3" --wait --submit --confirm |
| 102 | ``` |
| 103 | |
| 104 | ## macOS App Store flow |
| 105 | |
| 106 | Archive with the helper: |
| 107 | |
| 108 | ```bash |
| 109 | asc xcode archive \ |
| 110 | --project "MacApp.xcodeproj" \ |
| 111 | --scheme "MacApp" \ |
| 112 | --configuration Release \ |
| 113 | --clean \ |
| 114 | --archive-path ".asc/artifacts/MacApp.xcarchive" \ |
| 115 | --xcodebuild-flag=-destination \ |
| 116 | --xcodebuild-flag=generic/platform=macOS \ |
| 117 | --output json |
| 118 | ``` |
| 119 | |
| 120 | If your macOS export produces a `.pkg`, use Xcode export with your `ExportOptions.plist`, then upload the package: |
| 121 | |
| 122 | ```bash |
| 123 | xcodebuild -exportArchive \ |
| 124 | -archivePath ".asc/artifacts/MacApp.xcarchive" \ |
| 125 | -exportPath ".asc/artifacts/MacAppExport" \ |
| 126 | -exportOptionsPlist "ExportOptions.plist" \ |
| 127 | -allowProvisioningUpdates |
| 128 | |
| 129 | asc builds upload \ |
| 130 | --app "APP_ID" \ |
| 131 | --pkg ".asc/artifacts/MacAppExport/MacApp.pkg" \ |
| 132 | --version "1.0.0" \ |
| 133 | --build-number "123" \ |
| 134 | --wait |
| 135 | ``` |
| 136 | |
| 137 | For `.pkg` uploads, `--version` and `--build-number` are required because they are not auto-extracted like IPA metadata. |
| 138 | |
| 139 | ## Raw xcodebuild fallback |
| 140 | |
| 141 | Use raw `xcodebuild` only when neither `asc xcode archive --help` nor |
| 142 | `asc xcode export --help` covers a project-specific |