OSX:使用不同的参数运行应用程序的多个实例

时间:2023-01-18 19:37:33

I need to run multiple instances of Google Chrome but with different arguments.

我需要运行多个Google Chrome实例,但使用不同的参数。

What I have tried:

我尝试过的:

open -n -a "Google Chrome" --args --some-param-A

Fine, a new instance of Chrome is launched. Checking the command line parameters using chrome://version is also OK, --some-param-A is there.

很好,推出了一个新的Chrome实例。使用chrome:// version检查命令行参数也没关系, - some-param-A就在那里。

Now I would like to open a second instance but with different command line parameters.

现在我想打开第二个实例,但使用不同的命令行参数。

open -n -a "Google Chrome" --args --some-param-B

A second instance is launched, but it is started with --some-param-A again. I need it to start with --some-param-B though.

第二个实例已启动,但它再次以--some-param-A启动。我需要它开始--some-param-B虽然。

I also tried the -F (--fresh) option, did not help either. Seems that arguments after --args are read only once.

我也尝试了-F(--fresh)选项,也没有帮助。似乎--args之后的参数只读一次。

How can I fix that? Thanks!

我该如何解决这个问题?谢谢!

1 个解决方案

#1


Have you tried passing --user-data-dir to Chrome when you launch it from the command line?

从命令行启动时,您是否尝试将--user-data-dir传递给Chrome?

It seems to be a known issue and using --user-data-dir (without a specified directory) is a workaround.

这似乎是一个已知问题,使用--user-data-dir(没有指定目录)是一种解决方法。

Works Cited: https://askubuntu.com/questions/35392/how-to-launch-a-new-instance-of-google-chrome-from-the-command-line

作品引用:https://askubuntu.com/questions/35392/how-to-launch-a-new-instance-of-google-chrome-from-the-command-line

#1


Have you tried passing --user-data-dir to Chrome when you launch it from the command line?

从命令行启动时,您是否尝试将--user-data-dir传递给Chrome?

It seems to be a known issue and using --user-data-dir (without a specified directory) is a workaround.

这似乎是一个已知问题,使用--user-data-dir(没有指定目录)是一种解决方法。

Works Cited: https://askubuntu.com/questions/35392/how-to-launch-a-new-instance-of-google-chrome-from-the-command-line

作品引用:https://askubuntu.com/questions/35392/how-to-launch-a-new-instance-of-google-chrome-from-the-command-line