Running multiple proceses of the same Cocoa app

Mar 31, '01 11:11:34AM

Contributed by: Anonymous

Not sure if this is by any means useful, but here you go:

You can run more than one instance of the same Cocoa app, for example two Clock apps running under the different process id, from the command line. It is pretty simple to do:

  1. Launch Terminal.app
  2. Using Finder, navigate to the app you want to run
  3. Control-click, then select the 'Show Package Contents' item
  4. Open ./Contents/MacOS folder. There is usually only one executable file.
  5. Drag and drop the file on the terminal window. This prints a path to the file.
  6. Put '&' at the end of the path and type return
  7. Repeat 5 and 6
Now, you have two processes of the app.
Caveat: GUI apps are not intended to be executed by this way. If more than one instances are running, they access the same configuration files, e.g. a preferences file. So, there is a chance to corrupt these files. Do it at your own risk and just for entertainment.

Comments (0)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2001033111113460