Is there a way to switch Android users from the command line?
Yes there is.
When the community discovered this feature in android 4.1 (the code was exist but has not been declared yet so Google did not open the feature in Settings), I remember playing with this in my Nexus 4.

So, here are some commands that I remember for the android Terminal:


Create new user: pm create-user User_Name
To switch between users: am switch-user User_ID
To get the list of all the users: pm list users
To delete a user: pm remove-user User_ID


Hope this helps.