Xcode build and export
Build, archive, 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.
MCP get_skill({ skillId: "xcode-build-and-export-ddc70720" })Use this skill with your agent
Create a free account and connect via MCP
# Xcode build and export 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. ## Preconditions - Xcode and command line tools are installed. - Signing identity and provisioning profiles are available, or automatic signing is enabled. - App Store Connect auth is configured when upload or build lookup is needed. ## Manage version and build numbers ```bash asc xcode version view asc xcode version edit --version "1.3.0" --build-number "42" asc xcode version bump --type build asc xcode version bump --type patch ``` 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"` for deterministic reads in multi-target projects. To avoid low build-number rejects, resolve a remote-safe build number first: ```bash asc builds next-build-number --app "APP_ID" --version "1.2.3" --platform IOS --output json asc xcode version edit --build-number "NEXT_BUILD" ``` ## Preferred iOS/tvOS/visionOS build flow ### 1. Archive with asc ```bash asc xcode archive \ --workspace "App.xcworkspace" \ --scheme "App" \ --configuration Release \ --clean \ --archive-path ".asc/artifacts/App.xcarchive" \ --xcodebuild-flag=-destination \ --xcodebuild-flag=generic/platform=iOS \ --output json ``` Use `--project "App.xcodeproj"` instead of `--workspace` for project-only apps. ### 2. Export with asc ```bash asc xcode export \ --archive-path ".asc/artifacts/App.xcarchive" \ --export-options "ExportOptions.plist" \ --ipa-path ".asc/artifacts/App.ipa" \ --xcodebuild-flag=-allowProvisioningUpdates \ --output json ``` If `ExportOptions.plist` uses direct App Store Connect upload, add `--wait` to poll for build discovery and processing: ```bash asc xcode export \ --archive-path ".asc/artifacts/App.xcarchive" \ --export-options "UploadExportOptions.plist" \ --ipa-path ".asc/artifacts/App.ipa" \ --wait \ --output json ``` ### 3. Upload or publish Upload an exported IPA: ```bash asc builds upload --app "APP_ID" --ipa ".asc/artifacts/App.ipa" --wait ``` Distribute to TestFlight: ```bash asc publish testflight --app "APP_ID" --ipa ".asc/artifacts/App.ipa" --group "GROUP_ID" --wait ``` Publish to the App Store: ```bash asc publish appstore --app "APP_ID" --ipa ".asc/artifacts/App.ipa" --version "1.2.3" --wait asc publish appstore --app "APP_ID" --ipa ".asc/artifacts/App.ipa" --version "1.2.3" --wait --submit --confirm ``` ## macOS App Store flow Archive with the helper: ```bash asc xcode archive \ --project "MacApp.xcodeproj" \ --scheme "MacApp" \ --configuration Release \ --clean \ --archive-path ".asc/artifacts/MacApp.xcarchive" \ --xcodebuild-flag=-destination \ --xcodebuild-flag=generic/platform=macOS \ --output json ``` If your macOS export produces a `.pkg`, use Xcode export with your `ExportOptions.plist`, then upload the package: ```bash xcodebuild -exportArchive \ -archivePath ".asc/artifacts/MacApp.xcarchive" \ -exportPath ".asc/artifacts/MacAppExport" \ -exportOptionsPlist "ExportOptions.plist" \ -allowProvisioningUpdates asc builds upload \ --app "APP_ID" \ --pkg ".asc/artifacts/MacAppExport/MacApp.pkg" \ --version "1.0.0" \ --build-number "123" \ --wait ``` For `.pkg` uploads, `--version` and `--build-number` are required because they are not auto-extracted like IPA metadata. ## Raw xcodebuild fallback Use raw `xcodebuild` only when `asc xcode archive/export --help` does not cover a project-specific option. Prefer passing extra arguments through `--xcodebuild-flag` first. ```bash xcodebuild -showBuildSettings -scheme "App" ``` ## Troubleshooting ### No profiles for bundle ID during export - Add `--xcodebuild-flag=-allowProvisioningUpdates` to `asc xcode export`. - Verify the Apple ID is logged into Xcode. - Verify profiles with the `asc-signing-setup` skill. ### CFBundleVersion too low ```bash asc builds next-build-number --app "APP_ID" --version "1.2.3" --platform IOS asc xcode version edit --build-number "NEXT_BUILD" ``` Then rebuild and upload again. ### Build rejected for missing macOS icon macOS requires ICNS icons with all required sizes. Fix the asset catalog, rebuild, then export/upload again. ## Notes - Prefer `asc xcode archive` and `asc xcode export` for deterministic local artifacts. - Use `--overwrite` only when replacing existing local artifacts intentionally. - Use `--wait` on upload/publish paths when the next step depends on processed builds. - For submission readiness, use `asc-submission-health`.
Related Skills
More skills in Mobile App Development
Android Design Guidelines
Material Design 3 and Android platform guidelines. Use when building Android apps with Jetpack Compose or XML layouts, implementing Material You, navigation, or accessibility. Triggers on tasks involving Android UI, Compose components, dynamic color, or Material Design compliance.
Android Java Skill
Android Java development with MVVM, ViewBinding, and Espresso testing
Android Kotlin
Android Kotlin development with Coroutines, Jetpack Compose, Hilt, and MockK testing
Appium Skill
Generates production-grade Appium mobile automation scripts for Android and iOS in Java, Python, or JavaScript. Supports real device and emulator testing locally and on TestMu AI cloud with 100+ real devices. Use when the user asks to automate mobile apps, test on Android/iOS, write Appium tests, or mentions "Appium", "mobile testing", "real device", "app automation". Triggers on: "Appium", "mobile test", "Android test", "iOS test", "real device", "app automation", "UiAutomator", "XCUITest driver", "TestMu", "LambdaTest".
Apple Appstore Reviewer
Serves as a reviewer of the codebase with instructions on looking for Apple App Store optimizations or rejection reasons.
App Rejection Recovery
When the user's app or update was rejected by Apple App Review or Google Play Review and they need to diagnose why, fix it, and resubmit fast. Use when the user mentions "app rejected", "App Review rejection", "guideline violation", "Apple rejected my app", "Google Play rejected", "Play policy violation", "Resolution Center", "metadata rejection", "binary rejection", "guideline 2.1", "guideline 4.3", "guideline 5.1.1", "Sign in with Apple required", "Apple ID rejection", "Play Store suspension", "appeal", "I need to respond to App Review", or "expedited review". For pre-submission listing health, see aso-audit. For metadata-only fixes, see metadata-optimization.
Explore Other Categories
Skills from other categories with shared topics
.NET Backend Development Patterns
Master C#/.NET backend development patterns for building robust APIs, MCP servers, and enterprise applications. Covers async/await, dependency injection, Entity Framework Core, Dapper, configuration, caching, and testing with xUnit. Use when developing .NET backends, reviewing C# code, or designing API architectures.
/hub:init — Create New Session
Create a new AgentHub collaboration session with task, agent count, and evaluation criteria.
/understand-chat
Use when you need to ask questions about a codebase or understand code using a knowledge graph