Google Chrome Profiles on OSX

Introduction

The following is a short guide to setting up multiple profiles for Google Chrome on Mac OSX.

Replace text that appears as {variable} with whatever is appropriate for your particular profile name.

Note: this guide assumes that you installed Google Chrome under your local user directory in ~/Applications/, and that the profile data should be saved under ~/Library/.

Creating the shell script:

$ mkdir ~/bin/
$ cd ~/bin/

$ emacs google-chrome-{profile}

Enter the following text, substituting your profile name as desired:

#!/bin/zsh

PROFILE_NAME="{profile}"
GOOGLE_CHROME="/Users/$USER/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
USER_DIR="/Users/$USER/Library/Application Support/Google/Chrome/${PROFILE_NAME}"

exec $GOOGLE_CHROME \
    --enable-udd-profiles \
    --user-data-dir=$USER_DIR &

$ chmod +x google-chrome-{profile}

Confirm that the new profile works from the command-line:

Run:

$ ~/bin/google-chrome-{profile}

A new Google Chrome instance should now launch and execute the first-run script.  If this does not happen, please debug before proceeding.

Creating the application launcher:

$ cd ~/Applications/
$ mkdir -p "Google Chrome ({profile}).app/Contents/MacOS/"
$ ln -s ~/bin/google-chrome-{profile} \
    "Google Chrome ({profile}).app/Contents/MacOS/Google Chrome ({profile})"

Confirm that the new application works from the Finder:

Open the ~/Applications folder in the Finder and double click on the Google Chrome ({profile}) icon.  

Note: the icon will appear as generic executable for now.

Change the icon of the new application:
  1. Single click on the new application in the Finder and Get Info ⌘I
  2. Find a file from which to copy the new icon and Get Info ⌘I
  3. Copy ⌘C the icon from upper left of the source file
  4. Paste ⌘P it into the icon on the upper left of the new application
Change the theme of the new Google Chrome profile:
  1. Launch the new application
  2. Click Chrome > Preferences ⌘,
  3. Click Get Themes and select a new theme for the profile
Repeat as desired:

Create as many profiles as you like, changing the name of the script and the application, modifying the shell script accordingly, and setting unique icons.

Rejoice:

The new application can be dragged to the dock or the Desktop and run just like any other OSX application, or run from the command line as needed.

Navigation

  Sign in   Recent Site Activity   Terms   Report Abuse   Print page  |  Powered by Google Sites