Tutorials Search / Native Mac IDE / Upload to TestFlight with the agent
📝 Written ● Advanced Updated 2026-05-13

Upload to TestFlight with the agent

Stop clicking through Xcode's Organizer. Configure an App Store Connect API key once, then say "ship this to TestFlight" in chat — the agent archives, exports, signs, and uploads.

Shipping an iOS build to TestFlight is a sequence of small chores. Archive the app for release. Export an IPA with App Store distribution settings. Validate it against your provisioning profile. Upload to App Store Connect. Wait for processing. Re-check that the build appeared. Every step has its own dialog or command, and every step is the same every time. It is the kind of work humans should not be doing by hand.

Xcode's Organizer makes this slightly less painful by stitching the steps into a wizard, but it's still you driving. You click Distribute, you pick the destination, you wait, you click Next, you wait, you click Upload. If anything fails mid-sequence — a missing capability, a duplicated build number, an expired profile — you start over.

The LingCode agent already has the tools that drive each step (xcodebuild archive, xcodebuild -exportArchive, xcrun altool --upload-app) and the context it needs (your project, your bundle ID, your signing identity in Keychain). What's missing for an end-to-end "ship it" is one credential: an App Store Connect API key it can sign upload requests with. Once you've registered that key, "Upload this build to TestFlight" in chat triggers the entire sequence, streams a phase log, and tells you when the build is ready. This tutorial is the credential setup plus the actual ship turn.

What you'll learn

Prerequisites: A buildable iOS target, a paid Apple Developer account, an App Store Connect record for your bundle ID, and a valid signing identity in Keychain. The agent uploads — it doesn't create the app record or fix expired certificates for you.

Step 1: Generate an API key in App Store Connect

1

One-time setup on appstoreconnect.apple.com

Sign in to App Store Connect with an Account Holder or Admin role. Go to Users and Access → Integrations → App Store Connect API → Team Keys. Click Generate API Key (or use an existing one if you already have one for TestFlight uploads).

Give the key the App Manager role — that's enough for TestFlight uploads and avoids over-granting. Download the .p8 file when prompted. You only get one chance to download it; treat it like any other credential.

Note three values you'll need next: the Issuer ID (shown at the top of the page), the Key ID (next to the key you just made), and the path to the .p8 file.

Step 2: Register the key with LingCode

2

One prompt to the agent

Open the AI chat panel and say:

Set my App Store Connect API key. Issuer ID is <your-issuer-id>, Key ID is <your-key-id>, p8 is at /Users/me/Downloads/AuthKey_<key-id>.p8

The agent calls the internal set_asc_api_key tool. Your credentials land in the LingCode Keychain under the service LingCode; the .p8 contents are stored, not the file path, so you can delete the original safely.

Confirming it stuck: ask the agent "Is my ASC key configured?" — it'll check Keychain and report. You only run this step once per machine.

Step 3: Make sure the project builds

3

Local archive first, always

Before involving the network and Apple, prove the archive works locally. In chat: Archive the app for release. The agent runs xcodebuild archive with your Release configuration, streams the build log into the run console, and reports the archive path.

If this step fails, fix the underlying issue (signing, missing capabilities, broken Info.plist) before moving on. Many uploads die at this step the first time, and notary-service errors are far worse to debug than a local archive failure.

Step 4: Trigger the upload

4

The actual ship command

Once the archive succeeds, say:

Upload this build to TestFlight.

The agent calls archive_and_upload_testflight (or its narrower upload-only variant if you already have an archive). Internally it: exports an IPA from the archive with App Store distribution settings → runs xcrun altool --upload-app against App Store Connect → polls for processing → reports the build number you can find in TestFlight.

Step 5: Watch the phase log

5

Live status, not log spam

The agent streams a phase-by-phase log into the run console: Archiving → Exporting IPA → Validating → Uploading → Processing. Each phase is timed. Uploading is the slowest in absolute time (your IPA is gigabytes); Processing can take 5–30 minutes on Apple's side and runs asynchronously.

You can leave the chat tab and the agent will surface a notification when the build is available in TestFlight, or fails processing.

Step 6: When uploads fail

6

The four most common reasons

  • Signing identity not in Keychain — you need a Developer ID / Apple Distribution cert installed. The agent will say so plainly.
  • Bundle version already used — Apple rejects re-uploads with the same CFBundleVersion. Bump CURRENT_PROJECT_VERSION in your build settings, archive again. (Ask the agent: "Bump build number and re-archive.")
  • Entitlements mismatch — provisioning profile doesn't include something .entitlements claims. If you suspect an agent edit caused this, see Undo bad AI edits.
  • Notary or processing rejection — Apple returns specific error codes; the agent surfaces them. Common case: missing required device family in UIDeviceFamily. Fix in Info.plist and re-archive.
This is agent-driven, not one-click. There's no "Upload" button in the toolbar today — the entire flow lives in the chat panel. Future versions may add a one-click surface; for now, you prompt, the agent ships.

What's next