xcpretty / xcode-install

🔽 Install and update your Xcodes
https://fastlane.tools
MIT License
2.59k stars 239 forks source link

Add --email option to xcversion #271

Closed pronebird closed 5 years ago

pronebird commented 6 years ago

Please add --email option to make it possible to run xcversion without email prompt

timsutton commented 6 years ago

By e-mail, do you mean the developer Apple ID?

One way to do this is to run it once, let it prompt you for your developer Apple ID and password. It will store the password securely in the macOS keychain.

Then, you can set/export the FASTLANE_USER environment variable to be equal to the Apple ID you used for this prompt. When xcversion runs, it will use that Apple ID and then retrieve the corresponding password from the keychain.

pronebird commented 6 years ago

Yes, I mean apple ID. I think passing this via environment is not very convenient and not intuitive + pollutes the environment, and --help does not mention this at all.

timsutton commented 6 years ago

I think env cars are generally preferable for CI though, and since they can be set securely via a CI platform / Jenkins.

I totally agree the help could be clearer about this, but I’m not sure we would want to have to deal with an option flag for it - what behaviour should happen if the end var is set too, or if they are both present and don’t match, which one takes precedence? We’d have to handle those situations as well.

pronebird commented 6 years ago

I agree that makes sense for CI.

I think I will just follow your suggestion and use FASTLANE_USER and put a sticker on my 💻 to remind this to myself. That should avoid passing the appleid between calls to xcversion as well.

But it would be great to outline that in —help. I use many CLI tools and It gets pretty hard to remember all of the tricks :)

pronebird commented 5 years ago

Closing because it seems that the underlying issue I had was due to xcversion picking up the apple id from fastlane/ folder. Running xcversion eslewhere should ask for email.