Summary:
Case 1:
* You don't want 2FA enabled
- Update Gemfile with fastlane 2.173.0 and run
bundle install
, bundle update fastlane
, or bundle update
- Use
SPACESHIP_SKIP_2FA_UPGRADE=1
in your CI
Case 2:
* You have 2FA enabled
* You only need non-enterprise account
- Generate
APP_STORE_CONNECT_API_KEY
from appstore connect using an Account Holder role.

It looks like
-----BEGIN PRIVATE KEY-----\nabcdef12345abcdef12345\n-----END PRIVATE KEY-----
- Add it to your CI as APP_STORE_CONNECT_API_KEY environment variable
lane :get_app_store_connect_api_key do
ensure_env_vars(
env_vars: [
'APP_STORE_CONNECT_API_KEY'
]
)
app_store_connect_api_key(
key_id: "12345ABCDEF",
issuer_id: "1234abcd-12ab-12ab-12ab-123456abcdef",
key_content: "#{ENV["APP_STORE_CONNECT_API_KEY"]}".gsub('\n', '\\n'),
in_house: false,
)
end
- Pass it to your lanes
get_provisioning_profile(api_key: get_app_store_connect_api_key)
sigh(api_key: get_app_store_connect_api_key)
pilot(api_key: get_app_store_connect_api_key)
Case 3:
* You have 2FA enabled
* You need enterprise account and fetch profiles
- Run
fastlane spaceauth -u user@email.com
Use the output as FASTLANE_SESSION
environment variable on your CI.
You still need to include FASTLANE_PASSWORD
Note that this only lasts for 8 hours
Case 4:
* You have 2FA enabled
* You need enterprise or non-enterprise account
* You need to upload to appstore
Create FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD from https://appleid.apple.com/account/manage
Set it as environment variable in your ci
Case 5:
* You have 2FA enabled
* You need to download dsyms from appstore connect
- Run
fastlane spaceauth -u user@email.com
Use the output as FASTLANE_SESSION
environment variable on your CI.
You still need to include FASTLANE_USER
and FASTLANE_PASSWORD
Note that this only lasts for 8 hours