Fastlane Boarding with Two-Factor Authentication

Fastlane doesn't work for Apple id with two factor authentication on continuous integration working with Gitlab

  1. On yout machine when CI is running, go to the terminal and type the following command:

    fastlane spaceauth -u my.account@gmail.com
  2. Then fastlane will ask you about the code: Please enter 6 digits code:. Get it from another trusted device and type it here.

  3. You will receive FASTLANE_SESSION key. Just copy and paste it.
  4. Login to your gitlab account that is used along with your CI and go to Settings > CI/CD > Variables. Then define FASTLANE_SESSION variable, type the value and save.
  5. Run your job again.

Automating 2FA using Fastlane/CircleCI

You can authenticate with Apple through API key. You can generate the key here: https://appstoreconnect.apple.com/access/api.

Once you have the key.p8 file, you can used to auth with the fastlane command: app_store_connect_api_key as follow:

app_store_connect_api_key(
key_id: "ABCDEFG",
issuer_id: "Your_issuer_id",
key_content: File.read("./key.p8").chomp,
duration: 1200,
in_house: false
)

After the execution of the command, the key session is store in the following env var: APP_STORE_CONNECT_API_KEY so your upload to testflight should look like this:

upload_to_testflight(
groups: ["Friends & Family","Mytest-Group"],
ipa: "./build/myapp.ipa",
api_key: Actions.lane_context[SharedValues::APP_STORE_CONNECT_API_KEY]
)

fastlane boarding process for fabric beta webpage setup

Mike from Fabric & Firebase here. I think you're looking for "Share Links" from Beta. After your first build, you can click on Share Links under the Beta tab.

Share Links

From there, you click on "+ Create New"

Click on Create New

and then setup the link with the necessary information. You can also optionally an email domain restriction if you only want testers from your company's domain.

Set up share link

After that, you'll have a static page where folks can sign up to test.

Enter email address for beta app access

Can I turn off two-factor authentication for an account that is used only in build machine?

You can't turn off two-factor authentication, but you should be able to use an app-specific password.

  1. Go to https://appleid.apple.com and log in
  2. In the Security section, click on "Generate password..."
  3. Give your password a name
  4. Copy the password that is shown; Once you close the dialog box you cannot see it again.
  5. Configure that password on your build machine.


Related Topics



Leave a reply



Submit