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

xcodes + apple id login + 2FA #326

Open mlanders-spectra opened 7 months ago

mlanders-spectra commented 7 months ago

Hi,

steps/details that brought me here: 1) ran into an issue in an iOS build pipeline where xcversion was not detecting the presence of xcode 15 even when it existed on the host system and read about migrating from xcversion to xcodes 2) read through xcodes setup info + setup environment variables XCODES_USERNAME and XCODES_PASSWORD with apple id info 3) install latest version of xcodes via brew on a github mac runner within a workflow 4) run xcodes commands from within this workflow such as xcodes install 15 5) ran into an infinitely repeating prompt from xcodes for 2FA regarding the apple ID within the workflow which can't be satisfied because this is an automated process vs a human on a terminal.

I am in the process of migrating from use of xcversion to xcodes within a github pipeline that requires specific versions of xcode to do iOS app builds. Documentation on the xcversion side says that tool is deprecated and that xcodes should now be used in its place. Great! Everything makes sense to me so far with the exception of 1 point- the requirement of inputting an apple id user / pass. Since it seems to be required for some unknown reason, I defined values for the XCODES_USERNAME and XCODES_PASSWORD environment variables which are documented by xcodes as a way to automate this portion. Downloading xcode shouldn't require an apple ID, but now I've noticed my pipeline breaks if xcodes/apple decides that I need to use 2FA during a particular login session. This whole 2fa aspect of xcodes seems to break my automated use case. Is there a way to enable a completely automated workflow with xcodes? Ideally there would be a way to disable use of an apple ID entirely within xcodes. This current workflow makes no sense for an automated use case because the 2FA will sometimes break my workflow. Am I missing something here? I feel like this question makes sense but if someone reading this notices I'm missing something obvious here please let me know.

Mike

dogo commented 5 months ago

I have the same scenario, @mlanders-spectra did you found a way to skip the 2FA?

macintosh-HD commented 5 months ago

I ran into the same problem lately. Has anyone found a solution yet?