I need to access different accounts depending on the project I'm working on, so it'd be really nice to be able to save the credentials for multiple accounts and quickly switch between them using an alias.
Here's how I was envisioning this would work:
login [accountname] [alias]
If only an account name is specified, it's saved in the Keychain with no alias (the same as the current login command, just skipping the username prompt). If an alias is specified then the account name/alias pair is saved somewhere. Maybe in ~/.cupertino? I don't know the ruby conventions for saving config data like that.
logout [accountname or alias]
Logging out would delete the saved alias if one exists.
ios account myalias
Calling with no argument would print the active account.
I'm hoping to eventually hack this in myself, but I'm leaving this here for now if anyone else has any usage suggestions or gets inspired themselves :)
Just wanted to chime in to second this. Day to day I need to be managing devices on multiple accounts. Need a quick way to switch between them.
Well I just pushed very basic -- and incomplete -- account support to my own fork. My ruby skills are non-existent as well, so anyone who knows what they're doing will probably cringe if they look at it.
I also noticed there's another fork that contains multiple account support here: https://github.com/gvieira/cupertino. His implementation is a bit more complete, but I like the alias option that I added to mine.
Mine works with a ~/.cupertino config file that looks something like:
You can print the list of accounts with ios account and you can select which account is active with ios account test1. Right now you need to manually specify the aliases, but I'll probably add a way to set aliases in the login command.
ios account test1
Account management is something that feels out of scope for this utility, and isn't a feature that I'm choosing to include at this time. Sorry for the inconvenience.
As a suggested alternate approach, you could set cupertino logout / login as an action that's triggered as you cd into a directory, similar to how rvm does when encountering a .rvmrc file.
cupertino logout / login