Publish to TestFlight using Fastlane from VSTS

3.9k Views Asked by At

I'm trying to use the App Store VSTS extension to deploy a build of an app to TestFlight but something is failing at the authentication stage.

It seems to be related to the fact that iTunes is challenging for answers to the security questions for the account:

I'm not sure how to resolve this:

  • Is this an issue with the account I'm trying to use?
  • Is this an issue with how I have the service endpoint configured?
fastlane pilot upload -u ******** -i FrameworkDemoApp.Touch.ipa -q 466996 -r **** -a *****
--skip_submission true --skip_waiting_for_build_processing true

Login to iTunes Connect (********)

Service key is empty

/Users/vsts/.gem-cache/gems/fastlane-2.93.1/spaceship/lib/spaceship/two_step_client.rb:45:
in handle_two_step:` 
[!] Invalid 2 step response {"securityQuestions"=>{"questions"=>[{"id"=>134, "question"=>
"Where did you go the first time you flew on a plane?", "number"=>1, "userDefined"=>false},
{"id"=>136, "question"=>"What is your dream job?", "number"=>2, "userDefined"=>false}]},
"crResetEnabled"=>false,
"resetSecurityQuestionsSupportLink"=>"http://support.apple.com/kb/HT6170"}
2

There are 2 best solutions below

1
On BEST ANSWER

This issues seemed to be caused because the Apple ID I was using didn't have two step verification enabled.

This isn't made clear in the VSTS documentation: https://docs.fastlane.tools/best-practices/continuous-integration/#use-of-application-specific-passwords-and-spaceauth

0
On

You may be running into issues if you are using a personal account for this build and publish process and have 2FA enabled.

The "official" recommendation from Microsoft's documentation on the App Store VSTS extension is to NOT enable 2FA, but in order to avoid requiring 2FA the Apple ID used for publishing can't be of type "Account Holder".

See https://docs.fastlane.tools/best-practices/continuous-integration/#separate-apple-id-for-ci on the Fastlane docs, it also applies to more than just VSTS which might be why it was tough to find (I stumbled across it accidentally myself).