Open Google Chrome Specific Profile From Command Line Mac

13,209

Solution 1

You could try the following:

/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --args --profile-directory=Default

Referred from this answer.

Solution 2

To force a new profile window after Chrome has been launched:

open -n -a "Google Chrome" --args --profile-directory="<your profile>"

(where <your profile> is one of the Profile nn folder names found in ~/Library/Application Support/Google/Chrome/)

According to the manpage for open, the -n flag forces "a new instance of the application even if one is already running." You'll see second Chrome icon flash open briefly in the dock while the window loads but everything runs normal after that.

Solution 3

Try: open -a "Google Chrome" --args --profile-directory=<your profile name> Works every time for me.

Solution 4

To additionally pass a URL to open:

open -n -a "Google Chrome" --args https://example.com --profile-directory="Profile 5"

Share:
13,209

Related videos on Youtube

gradedcatfood
Author by

gradedcatfood

Updated on September 18, 2022

Comments

  • gradedcatfood
    gradedcatfood over 1 year

    I have been trying to open Google Chrome from command line but with no luck! I have tried How do I start Chrome using a specified "user profile"?

    My goal is to open Google Chrome with a specific profile such as "profile 1", "profile 2", or "Default" from the command line, using bash to be specific, on my Mac.

    UPDATE: 6/3/14 Got this to work BUT only works when opening chrome for the first time

    open -a Google\ Chrome --args --"profile-directory"="Profile 1"
    

    So How do you get --args to be accepted AFTER google chrome as already been launched??

  • gradedcatfood
    gradedcatfood almost 10 years
    That was a thread i opened on stack overflow and they sent me here. that didn't work. --args --directory-profile="PROFILE_WANTED" Dosnt work for me :/
  • Pacerier
    Pacerier over 6 years
    What's the point of --args?
  • rymo
    rymo over 6 years
    @Pacerier per the man page for open: "--args: All remaining arguments are passed to the opened application in the argv parameter to main(). These arguments are not opened or interpreted by the open tool." In other words, we're specifying that --profile-directory is a switch for Chrome and not for open itself.
  • tgf
    tgf about 5 years
    Seems to open a new profile even when the name is right. Also tried using the full path to the profile and still getting a brand-new profile each time. Has something changed?
  • Fer
    Fer about 2 years
    @communityBot As it’s currently written, your comment is unclear. Please edit to add additional details that will help me to understand what parts of my answer are unclear to you :P