Apple - Is there a simple way to have separate dock icons for different Chrome Profiles?
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.
UPDATE: I no longer use this method. Instead I now use Epichrome which is much easier to use and works better. I posted a new answer with this information and I suggest people use that instead.
Original answer with manual instructions:
I tried the script from @Maverick and it partly worked (thanks!) but I ran into some difficulties. The main problem is that the wrapped copy of Chrome, although it is independent, has its own icon, and works correctly on its own, cannot open URLs sent from other applications, so it doesn't work with Choosy.
Here is what worked for me, to get a second Chrome which can open links via Choosy, for example:
- Copy
Library/Application Support/Google/Chrome
toLibrary/Application Support/Google/ChromePersonal
in your home directory. This is optional; I wanted to transfer over my Chrome User profiles to the new instance. But if you're OK starting fresh you can skip this. - Copy
Google Chrome.app
to another location. I used/Applications/Google Chrome Personal.app
. - Copy my wrapper.sh script (below) into the app's
Contents/MacOS
directory. chmod +x wrapper.sh
- Modify
Contents/Info.plist
in this new app to:- point to the wrapper script (set
CFBundleExecutable
value towrapper.sh
) - have a unique
CFBundleIdentifier
(just add "Personal" to the existing value) - have a unique
CFBundleName
(just add "Personal" to the existing value) - have a unique
CFBundleDisplayName
(just add "Personal" to the existing value)
- point to the wrapper script (set
Here is my modified wrapper.sh script. Put it at /Applications/Google\ Chrome\ Personal.app/Contents/MacOS/wrapper.sh
and then edit the Info.plist as in step 4.
#!/bin/bash
# Wrapper script that starts independent instance of Google Chrome for Mac
# To use: copy Google Chrome.app to a new location. Copy this script into
# the Contents/MacOS directory of the copied app. Edit the copied app's
# Contents/Info.plist and change CFBundleExecutable to "wrapper.sh",
# and pick a unique CFBundleIdentifier.
# Instance data will be stored here. You can copy your existing data
# to this location if you want to preserve your existing user profile(s).
# You can also change this if you want to store the data somewhere else.
INSTANCE_DIR="/Users/$USER/Library/Application Support/Google/ChromePersonal"
# Find the Google Chrome binary:
CHOME_BIN="$(dirname "$0")/Google Chrome"
# Start Chrome
exec "$CHOME_BIN" --user-data-dir="$INSTANCE_DIR"
One caveat: I believe Chrome's auto-update feature will break this every time Chrome updates, meaning you need to re-do steps 3 and 4 after every Chrome update.
I now use Epichrome for this purpose. Epichrome is designed for creating site-specific browsers, but you can set up the filtering rules and the icon however you want, so it's perfectly capable of just creating a second Chrome with its own separate profile and dock icon. Epichrome-created browsers do work with Google's update mechanism, so they will all stay up to date with the latest version of Chrome.
It has a simple GUI—no coding or recompiling of Chrome required. I think it's a pretty solid solution for this problem.