MacOS – simple way to have separate dock icons for different Chrome Profiles

dockgoogle-chromemacossettings

I am using Google Chrome version 22 on OS X 10.8. I use separate user profiles (created using the native Chrome facility in Settings->Users) for my "regular" web browsing, and the web development that I do. I launch my web development profile from the regular Chrome profile window by clicking on the avatar in the top-left-hand-corner:

enter image description here

At the moment both of these profiles share a single dock icon. However, I would much prefer for each Chrome profile to have its own dock icon, with the windows managed separately – and ideally for the dock icons to be distinguished in some way. Is this easily possible? By 'easy', I mean things like rebuilding Chrome from source are not an option I'll consider.

Note: I would like to use the same, stable, version of Chrome for both profiles. It would be OK to have the same version installed twice as long as they can be kept separate and the dock icon distinguished.

Best Answer

For having two Chrome running at the same time you need to create a second runnable Google Chrome App.

You can create that second application by running the following script. It comes from this site, I copy and paste for readers' convenience:

#!/bin/bash

PROFILE_NAME=$1
mkdir -p "/Applications/Google Chrome $1.app/Contents/MacOS"

F="/Applications/Google Chrome $1.app/Contents/MacOS/Google Chrome $1"
cat > "$F" <<\EOF
#!/bin/bash

#
# Google Chrome for Mac with additional profile.
#

# Name your profile:
EOF

echo "PROFILE_NAME='$PROFILE_NAME'\n" >> "$F"

cat >> "$F" <<\EOF
# Store the profile here:
PROFILE_DIR="/Users/$USER/Library/Application Support/Google/Chrome/${PROFILE_NAME}"

# Find the Google Chrome binary:
CHROME_APP=$(mdfind 'kMDItemCFBundleIdentifier == "com.google.Chrome"' | head -1)
CHROME_BIN="$CHROME_APP/Contents/MacOS/Google Chrome"
if [[ ! -e "$CHROME_BIN" ]]; then
  echo "ERROR: Can not find Google Chrome.  Exiting."
  exit -1
fi

# Start me up!
exec "$CHROME_BIN" --enable-udd-profiles --user-data-dir="$PROFILE_DIR"
EOF

sudo chmod +x "$F"

Save it in a file (let's say create_second_chrome.sh in the Desktop folder), open the shell and execute it by passing as parameter the profile folder you want to associate to the second Chrome App. It will be called Google Chrome profile_folder_name. Let's suppose Google Chrome Development:

$ cd ~/Desktop
$ . create_second_chrome.sh Development

Now you can launch the new version of Chrome (Google Chrome Development) from the ~/Applications directory. You can set a different icon by right-clicking on the app and selecting 'Get Info'. You will see that this new version has its own icon on the dock and can be docked there if needed.