XcodesOrg / xcodes

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

Can we not set XCODE_USER and XCODE_PASSWORD? #198

Closed aelam closed 2 years ago

aelam commented 2 years ago

I see the username and password are saved in keychain can xcodes just access them from keychain without XCODE_USER and XCODE_PASSWORD environment variables?

MattKiazyk commented 2 years ago

hi @aelam

For sure - just don't set those environment variables XCODES_USERNAME/XCODES_PASSWORD and it'll look for them in the keychain

You'll see here it looks for the environment variable first, then goes to the keychain.

https://github.com/RobotsAndPencils/xcodes/blob/main/Sources/XcodesKit/XcodeInstaller.swift#L433

aelam commented 2 years ago

It would be better if the readme can be updated

There seems to be two weird cases to me

  1. The item in the keychain might be deleted automatically? I saw it saved but It was gone in some time
  2. When run xcodes list without environment varibles it keeps asking me to input username and password? Not sure it's random or every time. And not sure if it's because of the first problem

BTW, if it runs on CI machine, it would be better to add some instrument about sudoer settings

Thank you!