fastlane: 2-step verification: FASTLANE_SESSION parameter ignored by spaceship/match

New Issue Checklist

Issue Description

I’m using match to manage code signing, and I’m trying to set up my project to build on Travis CI. The Apple ID that I use for match is set up with 2 step verification, so I obviously want to avoid being asked to enter my password and verification code when building on the CI server.

Following the steps outlined in issue 7199, I’ve run fastlane spaceauth -u me@email.com and generated a web session, which I enter as the value of an environment variable called FASTLANE_SESSION in Travis CI. I’ve also created an app-specific password and set that value in an environment variable called FASTLANE_APPLE_APPLICATION_SPECIFIC_PASSWORD.

But when I run my lane, it still asks for a password rather than using the environment variables that I’ve set. What am I missing; how do I get match/spaceship to use the session rather than wait for a password?

Complete output when running fastlane, including the stack trace and command used
... [removed unnecessary stuff from the start of the build output]

$ echo -e "machine github.com\n login $CI_USER_TOKEN" >> ~/.netrc

$ fastlane dev
[17:23:03]: -------------------------------------------------
[17:23:03]: --- Step: Verifying required fastlane version ---
[17:23:03]: -------------------------------------------------
[17:23:03]: Your fastlane version 2.14.2 matches the minimum requirement of 2.14.2  ✅
[17:23:03]: ------------------------------
[17:23:03]: --- Step: default_platform ---
[17:23:03]: ------------------------------
[17:23:03]: Driving the lane 'ios dev' 🚀
[17:23:03]: -----------------------
[17:23:03]: --- Step: cocoapods ---
[17:23:03]: -----------------------
[17:23:04]: $ pod install
[17:23:16]: ▸ Analyzing dependencies
[17:23:16]: ▸ Downloading dependencies
[17:23:16]: ▸ Using AppsFlyerFramework (4.6.4)
[17:23:16]: ▸ Using Firebase (3.12.0)
[17:23:16]: ▸ Using FirebaseAnalytics (3.6.0)
[17:23:16]: ▸ Using FirebaseCore (3.4.7)
[17:23:16]: ▸ Using FirebaseInstanceID (1.0.8)
[17:23:16]: ▸ Using FirebaseMessaging (1.2.1)
[17:23:16]: ▸ Using GoogleInterchangeUtilities (1.2.2)
[17:23:16]: ▸ Using GoogleSymbolUtilities (1.1.2)
[17:23:16]: ▸ Using GoogleToolboxForMac (2.1.1)
[17:23:16]: ▸ Using HanekeSwift (0.10.1)
[17:23:16]: ▸ Using NibDesignable (3.0.0)
[17:23:16]: ▸ Using Realm (2.4.2)
[17:23:16]: ▸ Using RealmSwift (2.4.2)
[17:23:16]: ▸ Using SnapKit (3.1.2)
[17:23:16]: ▸ Generating Pods project
[17:23:16]: ▸ Integrating client project
[17:23:17]: ▸ Sending stats
[17:23:17]: ▸ Pod installation complete! There are 7 dependencies from the Podfile and 14 total pods installed.
[17:23:17]: -------------------
[17:23:17]: --- Step: match ---
[17:23:17]: -------------------
[17:23:19]: Successfully loaded '/Users/travis/build/my_org/my_app/fastlane/Matchfile' 📄

+----------------------+----------------------------------------------------------+
|                   Detected Values from './fastlane/Matchfile'                   |
+----------------------+----------------------------------------------------------+
| git_url              | https://github.com/my_org/my_certificate_repo.git |
| app_identifier       | ["com.example.app", "com.example.app.dev"]                 |
| username             | me@email.com                                         |
+----------------------+----------------------------------------------------------+


+-----------------------+----------------------------------------------------------+
|                             Summary for match 2.14.2                             |
+-----------------------+----------------------------------------------------------+
| type                  | appstore                                                 |
| git_url               | https://github.com/my_org/my_certificate_repo.git |
| app_identifier        | ["com.example.app", "com.example.app.dev"]                 |
| username              | me@email.com                                         |
| git_branch            | master                                                   |
| keychain_name         | login.keychain                                           |
| readonly              | false                                                    |
| team_id               | my_team_id                                               |
| verbose               | false                                                    |
| force                 | false                                                    |
| skip_confirmation     | false                                                    |
| shallow_clone         | false                                                    |
| force_for_new_devices | false                                                    |
| skip_docs             | false                                                    |
| platform              | ios                                                      |
+-----------------------+----------------------------------------------------------+

[17:23:19]: Cloning remote git repo...
[17:23:20]: 🔓  Successfully decrypted certificates repo
[17:23:20]: You can also run `match` in readonly mode to not require any access to the
[17:23:20]: Developer Portal. This way you only share the keys and credentials
[17:23:20]: $ fastlane match --readonly
[17:23:20]: More information https://github.com/fastlane/fastlane/tree/master/match#access-control
[17:23:20]: Verifying that the certificate and profile are still valid on the Dev Portal...
-------------------------------------------------------------------------------------
The login information you enter will be stored in your macOS Keychain
You can also pass the password using the `FASTLANE_PASSWORD` environment variable
More information about it on GitHub: https://github.com/fastlane/fastlane/tree/master/credentials_manager
-------------------------------------------------------------------------------------
Password (for me@email.com): 

Appfile

app_identifier "com.example.app"
apple_id "me@email.com"

team_id "my_team_id"

for_lane :dev do
  app_identifier 'com.example.app.dev'
end

Fastfile

fastlane_version "2.14.2"

default_platform :ios

platform :ios do
  before_all do
    cocoapods
  end

  desc "MyApp Dev build"
  lane :dev do
    match(type: "appstore")
    gym(
      workspace: "MyApp.xcworkspace",
      scheme: "MyApp Dev",
      configuration: "Debug"
    )
  end

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

@Badmuts If it’s OK with you, I’m going to close this issue then, and we’ll continue to work on pilot/deliver stuff in #8374, #8298, #7380 👍