Skip to content
RentCloudMac

How do you sign an iOS app and upload it to App Store Connect from a remote Mac?

Signing is the step that most often fails on a fresh Mac. Done once with a dedicated keychain and an API key, it becomes a two-command routine.

Updated , by the RentCloudMac team

Quick answer

How do you sign an iOS app and upload it from a remote Mac?

Import your Apple Distribution certificate into a keychain, archive with xcodebuild, then export with an ExportOptions.plist whose destination is upload and an App Store Connect API key. RentCloudMac Macs, from $92 a month and paid in Monero, give you the administrator rights and clean keychain this requires.

In brief
  • You need: a paid Apple Developer Program membership, an Apple Distribution certificate (.p12) and an App Store Connect API key (.p8).
  • Keychain: a dedicated build keychain keeps the signing key separate from the login keychain.
  • Archive: xcodebuild archive with automatic or manual signing.
  • Upload: xcodebuild -exportArchive with destination = upload sends the build to App Store Connect.
  • Your keys stay yours: RentCloudMac never asks for a certificate's private key or an Apple Account password.

What are the steps from certificate to uploaded build?

  1. Create an API key

    In App Store Connect, Users and Access, Integrations, create a key with the App Manager role. Note the Key ID and Issuer ID and download the .p8 once.

  2. Copy the signing assets to the Mac

    Copy the .p12 certificate and the .p8 key over scp into a folder only your user can read.

  3. Create a build keychain

    Create a keychain, unlock it, import the .p12 and allow codesign to use the key without a prompt.

  4. Archive

    Run xcodebuild archive for the generic iOS destination with -allowProvisioningUpdates and the API key flags.

  5. Export and upload

    Run xcodebuild -exportArchive with an ExportOptions.plist set to app-store-connect and upload.

  6. Check App Store Connect

    The build appears under TestFlight after Apple's processing; then submit it for review.

Keychain set-up for signing
KC=build.keychain-db
security create-keychain -p "$KC_PASS" $KC
security set-keychain-settings -lut 21600 $KC
security unlock-keychain -p "$KC_PASS" $KC
security import dist.p12 -k $KC -P "$P12_PASS" -T /usr/bin/codesign -T /usr/bin/security
security set-key-partition-list -S apple-tool:,apple: -s -k "$KC_PASS" $KC
security list-keychains -d user -s $KC login.keychain-db
security find-identity -v -p codesigning
ExportOptions.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>app-store-connect</string>
  <key>destination</key><string>upload</string>
  <key>signingStyle</key><string>automatic</string>
  <key>teamID</key><string>ABCDE12345</string>
</dict></plist>
Archive and upload
AUTH="-authenticationKeyPath $HOME/keys/AuthKey_KEYID.p8 -authenticationKeyID KEYID -authenticationKeyIssuerID ISSUER-UUID"

xcodebuild -workspace MyApp.xcworkspace -scheme MyApp -configuration Release \
  -destination 'generic/platform=iOS' -archivePath build/MyApp.xcarchive \
  -allowProvisioningUpdates $AUTH archive

xcodebuild -exportArchive -archivePath build/MyApp.xcarchive \
  -exportOptionsPlist ExportOptions.plist -exportPath build/export \
  -allowProvisioningUpdates $AUTH

Why use an API key rather than your Apple Account on the server?

An API key can be limited to one role and revoked in a click, while an Apple Account sign-in opens everything and needs two-factor codes. With -authenticationKeyPath and its two IDs, xcodebuild manages provisioning profiles and uploads without any interactive sign-in, which is what you want on a Mac you reach over SSH or use as a CI runner. RentCloudMac never needs the customer's Apple Account; signing in to one on the Mac, for Xcode or App Store Connect, is the customer's choice.

The concepts behind certificates, identifiers and profiles are explained in what is iOS code signing.

Which file does what in iOS signing?

Files used to sign and upload an iOS app, and where to keep them
FileRoleKeep it
Apple Distribution certificate (.p12)Private key + certificate that signs the binaryBuild keychain; a copy off the Mac
Provisioning profile (.mobileprovision)Links app ID, certificate and entitlementsManaged by Xcode with automatic signing
App Store Connect API key (.p8)Authenticates uploads and profile updatesReadable by your user only; revoke when done
ExportOptions.plistTells xcodebuild how to exportIn the repository
.xcarchiveThe archived buildCopy off the Mac if you keep it

What goes wrong most often, and how do you fix it?

Most failures are a locked keychain, a missing certificate in the search list, or a profile that does not match the bundle ID. security find-identity -v -p codesigning must list your Apple Distribution identity; if it shows zero, the import or the keychain search list failed. "errSecInternalComponent" over SSH usually means the keychain is locked or the partition list was not set. A profile error with automatic signing is solved by -allowProvisioningUpdates with the API key.

No backups are included: keep source code in a remote repository and copy signing assets and builds off the Mac. Keep the .p12 and .p8 in your password manager, not only on the Mac.

Should you automate this with Fastlane?

Yes, once the manual route has worked one time. Fastlane's match stores certificates encrypted in a Git repository and upload_to_testflight wraps the upload. The walk-through is in Fastlane on a cloud Mac. According to RentCloudMac's price check of 3 December 2026, a Mac mini with 24 GB and 512 GB cost $249.00 a month at the median of the sellers listing that size, against $139 for Ship, the plan most signing pipelines run on. The wider workflow is on cloud Mac for iOS development.

What questions come up about signing on a cloud Mac?

Is it safe to put my distribution certificate on a rented Mac?

The Mac is yours alone for the rental. When a rental ends and is not renewed, the Mac is kept 3 days, then its disk is erased and macOS reinstalled before anyone else rents it. Still, delete the keychain and revoke the API key when you stop using the Mac.

Can I use xcrun altool instead?

altool can still upload with an API key, but xcodebuild -exportArchive with destination upload does export and upload in one step and is Apple's current route.

Do I need the Mac's desktop for signing?

No. Everything above runs over SSH. The desktop helps only if you prefer Xcode's Organizer window.

Why does codesign hang over SSH?

It is waiting for a keychain prompt nobody can see. Unlock the keychain and set the partition list as in the code above.

Will RentCloudMac ever ask for my keys?

No. The team never asks for an Apple Account password, a two-factor code, a certificate's private key or the account number.

Verdict
  • Use an App Store Connect API key and a dedicated keychain: no prompts, no Apple Account on the server.
  • One xcodebuild archive and one -exportArchive with destination upload replace the Organizer window.
  • Keep copies of every signing file off the Mac; plans and options are on pricing.

Sign and ship from your own cloud Mac

Ship gives you a clean macOS and administrator rights within 24 hours, paid in crypto.

Sources (3)
  1. Distributing your app for beta testing and releases — Apple
  2. Creating API keys for App Store Connect API — Apple
  3. Certificates — Apple

Read next

from $92 a month

Rent a Mac