Home/Guides/Sign in to Xcode with your Apple ID on a remote Mac: steps and the 2FA code

Sign in to Xcode with your Apple ID on a remote Mac: steps and the 2FA code

Updated · airankrush

What this guide covers

When you finish, your Apple Account is in Xcode's account list and your team shows up in the project's Team menu. You need: Xcode installed, and your Apple Account with its trusted device at hand.

Steps

  1. First, tell apart the account in Xcode and the Apple Account in the system

    Signing in to an Apple Account in System Settings brings in iCloud sync and Find My Mac. Adding an account in Xcode's Accounts settings only lets Xcode access the developer portal as you. If all you do is sign and upload, the latter is enough and there is no need to sign in at the system level.

    For both, we suggest an account used only for work. If you do sign in at the system level too, Find My Mac must stay off.

  2. Add the account in Xcode

    Following the steps in Xcode Help: open Xcode > Settings, go to Accounts, click the Add button (+) in the lower-left corner, choose the Apple account type and continue, then enter the account and password.

    The label in the interface varies between "Apple ID" and "Apple Account" depending on the Xcode version; the location is the same. Type the password by hand or fill it from your own password manager. Do not write it in Notes or a desktop file on the remote machine.

  3. Two-factor authentication: the code goes to your own devices

    When you sign in, Apple sends the verification code to your trusted devices, not to this remote Mac. Have your phone at hand before you start, and type the code in the remote desktop.

    The code expires, and if the remote picture lags it is easy to time out. Confirm keyboard input works in the remote desktop first, then start signing in. After a few failures in a row, pause before trying again; do not keep triggering new codes.

  4. Confirm your team and role

    After signing in, select the account on the Accounts page and the teams you belong to are listed on the right. An account that has not joined the Apple Developer Program has only one personal team, labeled "Personal Team". According to Xcode Help, it can install apps on a device, but you must join the developer program before publishing on the App Store.

    For a company account, also check your role. According to Apple's certificates overview, only the Account Holder or an Admin can create distribution certificates. With an insufficient role, automatic signing fails at the distribution step.

  5. Choose the team in the project

    Open the project, select the target, go to Signing & Capabilities, select "Automatically manage signing" under Signing, then pick your team from the Team menu. If no error appears, the account is usable.

    For how to choose between automatic and manual signing, see our guide on automatic versus manual signing.

  6. Do not rely on a signed-in account for unattended builds

    The sign-in session expires, and when it does it asks for a code again, with nobody watching the build machine. For command-line builds and uploads, use an App Store Connect API key instead. The xcodebuild help states that -allowProvisioningUpdates can use an account signed in to Xcode, or a key supplied with -authenticationKeyPath and related options.

  7. Before the rental ends: export certificates first, then remove the account

    The order matters. First, in Manage Certificates, export the signing certificate together with its private key as a .p12, move it to your own storage, and confirm on another device that it imports. Then select the account on the Accounts page and remove it, and sign out of the App Store and of the system-level Apple Account.

    The machine is reclaimed and erased after the rental ends, but signing out is something you have to do yourself. Do not count on the erase to do it for you.

FAQ

What if the verification code does not arrive or keeps timing out?

First confirm on your own phone that the Apple Account's trusted devices and phone number work. If slow remote input is causing the timeout, try again from a different local network; the delay depends on your local network connection.

Can support see the account I signed in to Xcode with?

The platform runs the operational and security monitoring it needs (processes, network connections, configuration state), but does not record screen contents or the content of your business data, and will not ask for your Apple Account or password. See the help center.

Can I sign in to a personal and a company account at the same time?

Xcode's account list accepts multiple accounts; pick the right team in each project's Team menu. Remove every one of them before the rental ends.

Can I publish to the App Store with a Personal Team?

No. A personal team is only for running your own app on a device. Distributing on the App Store requires joining the Apple Developer Program.

Pricing and availability: see the plans page · Help center (中文) · Refund policy (中文) · Telegram Contact support

Back to home · All guides