XcodesOrg / xcodes

The best command-line tool to install and switch between multiple versions of Xcode.
MIT License
3.59k stars 119 forks source link

useFastlaneAuth isn't finding session cookie in environment #280

Closed jnimis closed 1 year ago

jnimis commented 1 year ago

Hello,

We are trying to use the new --use-fastlane-auth option, running xcodes 1.3.0 on an M1 Mac, installed using homebrew, and have tested in a CI pipeline and on a local device. We export the FASTLANE_SESSION environment variable, then run the command xcodes install --use-fastlane-auth 14.2 and have tried including many variations of including or not including a --fastlane-user as a parameter.

Expected behavior: Xcode 14.2 is installed without further ado

Actual behavior: The command returns the error FASTLANE_SESSION not set then prompts for an AppleId, although the FASTLANE_SESSION is defined in the environment, as verified by running either printenv or echo $FASTLANE_SESSION.

jnimis commented 1 year ago

Sorry for the noise, we realized that we had an invalid session cookie, and were being prompted for a userId (without the FASTLANE_SESSION not set error). I had it confused with an older error.

It would, however, be nice to add some error messaging. I noticed that inside AppleSessionService-loginIfNeeded, when we don't have a valid session, it silently defaults to prompting for AppleID login. If the user was able to get a message "no valid session, defaulting to password login" it would definitely have cleared up our issue!