Skip to content

Instantly share code, notes, and snippets.

@iNamik
Created May 11, 2017 21:46
Show Gist options
  • Save iNamik/a5752e08bbf7e1f62b9e749889b1ec26 to your computer and use it in GitHub Desktop.
Save iNamik/a5752e08bbf7e1f62b9e749889b1ec26 to your computer and use it in GitHub Desktop.
Launch Multiple Chrome Instances on MAC
#
# Add the below chrome() function to your ~/.bash_profile
#
# Launch an anonymous instance - Profile is stored in /tmp with random name
# $ chrome
#
# Launch/relaunch a temporary named instance - Profile is stored in /tmp with specified name
# $ chrome name_in_all_lowercase
#
# Launch/relaunch a permanent named instance - Profile is stored in ~/Documents/ChromeProfiles with specified name
# $ chrome NameInMixedCase
chrome() {
if [ "$1" == "" ] ; then
pl=$( uuidgen )
pd="/tmp/chrome-profile-$pl"
else
pl=$( echo "$1" | tr "[:upper:]" "[:lower:]" )
if [ "$pl" == "$1" ] ; then
pd="/tmp/chrome-profile-$1"
else
mkdir -p "$HOME/Documents/ChromeProfiles"
pd="$HOME/Documents/ChromeProfiles/$1"
fi
fi
app="/Applications/Google Chrome.app"
open -n "${app}" --args --user-data-dir="$pd" > /dev/null 2>&1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment