Home‎ > ‎Mac OS X‎ > ‎

Multiple Instances of Chrome

I've found a need to run multiple instances of Chrome on my Mac OS X desktop, and tracked down one method to do it.

Essentially, you can start multiple instances by adding the --user-data-dir=some-directory option to the chrome command line.

The link above suggests making an apple script which then runs a shell script to start the app.  But a plain shell script or just adding the option at the command line works just as well.

So, if you want to be able to create temporary chrome instances that you can then throw away:

to save a bit of typing every time you do this, add to your .profile file:

chrome() {
    app="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
     ${app} --user-data-dir=$1 > /dev/null 2>&1;
     rm -r $1
    ) &

then at the prompt, type: source ~/.profile to load that into your current environment, it should load for when your shell starts in the future.

Then try: chrome /tmp/junk 

it should start up a brand new chrome session.

when you are done and quit that chrome session (note, you have to quit, not just close open windows), the /tmp/junk directory should be gone.