Instructions for creating Google Chrome Launcher Apps for differnt Chrome Profiles on MacOS
See Tweet thread for context or read below.
I have 7 Google Profiles that I actively switch between based on context. I like to keep them separate. It is both an attempt at separating the various sides of things as well as to avoid bloat by keeping extensions and history separate.
However, switching between profiles in Chrome is a collossal pain. Doubly so if you use services that use Google auth.
My needs were
- A quick way to launch Chrome in a particular profile
- Keep the launcher lightweight and make sure it does not interfere with any additional things I might want to do
- Visually diffrentiate the launchers
Create a launcher script to start Chrome in a particular profile. Add that as a shortcut.
I came across Platypus and decided to wrap the script as a MacOS app and give each launcher its own icon
- Create launcher script, say
chromeLauncherProfile1.sh
with the following line in it
open -na "Google Chrome" --args --profile-directory="Profile 1"
The -n is for new instance and -a is for app launching
Make sure the file is executable. Run
chmod +x ./chromeLauncherProfile1.sh
if needed
- Install Platypus and load the script from above in it. Choose Bash script option. Make sure you uncheck "Remain running after execution".
You can chose to have no interface for the launcher. I like to see immediate visual feedback so I use the progress bar view.
- Change icon to any image of your choice. I use a manipualted version of Chrome logo
- Create app and add shortcut to dock or desktop Please note: this approach will also make it available in spotlight search. So name the app something meaningful
Finding which profile is which is arguably the hardest part of this. The best way i have found is to look in the file structure to see where Chrome stores it.
On a standard installation of Chrome on MacOS, this is stored at ~/Library/Application Support/Google/Chrome/[Profile Name Folder]
cd ~/Library/Application\ Support/Google/Chrome/
cat Profile\ 1/Preferences | jq .account_info[0].email
This script will return the email associated with Profile 1
Note: You might have a profile folder called
Default
in addition to Profile 1, 2 etc.