Search code examples
ioscontinuous-integrationapp-store-connectfastlane

Sign in with the app-specific password you generated. If you forgot the app-specific password or need to create a new one -22938


Problem

While I'm trying to send my application via Fastlane I face with this error:

Sign in with the app-specific password you generated. If you forgot the app-specific password or need to create a new one, go to appleid.apple.com (-22938)

Transporter transfer failed.Sign in with the app-specific password you generated. If you forgot the app-specific password or need to create a new one, go to appleid.apple.com (-22938)Your account has 2 step verification enabled. Please go to https://appleid.apple.com/account/manage and generate an application specific password for the iTunes Transporter, which is used to upload builds. To set the application specific password on a CI machine using an environment variable, you can set the FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD variable.

Please provide your Apple Developer Program account credentials The login information you enter will be stored in your macOS Keychain Password (application-specific for [email protected])


Solution

  • Solution

    As the error message says, we need to create an app-specific password at the:

    http://appleid.apple.com

    address. Go to the security section and use the Generate Password.

    Generate Password

    Use the Generate Password link to create a new password. Copy and paste the password and don't forget you won't be able to find the password again after you click on the Done button.

    FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD

    Then, set the FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD environment variables at your bash or your .bash_profile file. This file could be different depending on your choice for the bash on your terminal. For example, if your bash of choice is ZSH like mine, you need to edit the .zshrc file.

    Then re-run your Fastlane with:

    bundle exec fastlane beta --verbose
    

    Note: When you can not enter the security code manually, as on a Continuous Integration system, you have to use other ways to log in. The application-specific password will not work if your action usage does anything else than uploading the binary, e.g. updating any metadata like setting release notes or distributing to testers, etc.

    Generating a login session for Apple ID

    As your CI machine will not be able to prompt you for your two-factor authentication or two-step verification information, you need to generate a login session for Apple ID in advance. You can get on your local machine this by running:

    fastlane spaceauth -u [email protected]
    

    What Else?

    ⚠️ If you've Apple ID without 2FA

    Apple ID without 2FA is deprecated! Apple announced that as of February 27th 2019, it would enforce 2-factor authentication on developer Apple IDs with the "Account Holder" role. Since then, they extended this rule to all roles, and then later throughout 2020 they slowly enforced all existing accounts to register 2FA. As of March 3rd, 2021, no accounts without 2FA registered are able to login until they register a 2FA method, essentially breaking all "non-2FA compliant Apple IDs" that still existed. For this reason, when using fastlane in your CI, you will have to work your way with 2FA.

    for more, please check the fastlane documentation .

    Hope this helps!