I want to run a command line that opens a new chrome window with another profile.
I tested the following commands:
Preconditions:
I have two profiles:
Profile 1andProfile 2Chrome is already running with
Profile 1
google-chrome --profile-directory="Profile 2"
The above command does nothing other than bringing focus to the currently running chrome with Profile 1
I also tried:
google-chrome --profile-directory="Profile 2" --new-window
The effect is the same.
I want to run a command line that opens a new chrome window with Profile 2 while there is already a Chrome window running with Profile 1
2 Answers
When adding new profile named Whatever, Chrome does not create profile folder with the same name. Naming convention is "Profile X", where X is integer. So, it may be the case to check the real profile folder name before executing the command.
chrome --profile-directory="Profile folder name" works fine on Ubuntu.
You may also find useful this answer and discussion
Some additional context to qba-dev's answer - can be a gotcha.
At least on my system, profiles actually start with "Default", and then iterate through "Profile X".
So, for original profile
google-chrome --profile-directory="Default" --new-windowFor second profile:
google-chrome --profile-directory="Profile 1" --new-windowEtc.
But also be aware the browser GUI muddies the water here in that the first profile Default is labeled "Person 1" in the profiles UI box. The second profile, "Profile 1" is labeled "work" (in my case) in the UI, etc. It is enough to create some confusion.
To further complicate... in my case in $HOME/config/google-chome there are directories: Default, 'Profile 1' and work. I believe the work directory exists from previously trying to call "work" profile from the command line
google-chrome --profile-directory="work" --new-windowInstead of this opening the existing work (Profile 1) profile, it created a third profile, identified with the 'work' directory in the configs folder, but associated to a "Person 2" profile in the UI.
The disconnect between UI & configuration labeling (and the offset in the increment count of profiles) is hopefully something that could potentially be addressed in future releases.
Chrome Version 88.0.4324.182 (Official Build) (64-bit)