macos 如何在 Mac 上启动 MonoDevelop 的多个实例?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1562929/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 06:29:24  来源:igfitidea点击:

How can I launch multiple instances of MonoDevelop on the Mac?

macosmonoxamarin.iosmonodevelop

提问by miguel.de.icaza

I would like to open a new MonoDevelop instance to work on a different project on the Mac, and the OS is currently preventing me from opening a new instance.

我想打开一个新的 MonoDevelop 实例来处理 Mac 上的另一个项目,而操作系统目前阻止我打开一个新实例。

回答by Mikayla Hutchinson

On Mac, if you have an app open and you try to launch it again, the Mac just switches to the open app. You can force it to open a new instance by passing the option "-n" to the launcher. In a terminal, run

在 Mac 上,如果您打开了一个应用程序并尝试再次启动它,Mac 只会切换到打开的应用程序。您可以通过将选项“-n”传递给启动器来强制它打开一个新实例。在终端中,运行

open -n /Applications/MonoDevelop.app

Note also that MonoDevelop is capable of opening multiple solutions. To do this, simply uncheck the "close current solution" checkbox in the "Open" dialog, or hold down the control key when clicking on one of the recently opened projects in the Welcome Page.

另请注意 MonoDevelop 能够打开多个解决方案。为此,只需取消选中“打开”对话框中的“关闭当前解决方案”复选框,或在单击欢迎页面中最近打开的项目之一时按住 control 键。

EDIT: For Xamarin Studio, which has replaced MonoDevelop on Mac, the command is

编辑:对于在 Mac 上取代 MonoDevelop 的 Xamarin Studio,命令是

open -n /Applications/Xamarin\ Studio.app

EDIT 2:

编辑2:

For Visual Studio for Mac, which has replaced Xamarin Studio, the command is

对于取代 Xamarin Studio 的 Visual Studio for Mac,命令是

open -n /Applications/Visual\ Studio.app

回答by Subfuzion

Using the shell to enter the command as others have described to launch an extra instance is fine, but I prefer having an icon on the dock that I can just click.

像其他人描述的那样使用 shell 输入命令来启动一个额外的实例很好,但我更喜欢在 Dock 上有一个我可以点击的图标。

It's easy to do:

很容易做到:

  1. Open AppleScript Editor and enter the following:

    do shell script "open -n /Applications/MonoDevelop.app/"

  2. Save with a name like "MonoDevelop Launcher"and make sure to specify Applicationfor the file format.

  3. Drag the icon to your dock.

  4. Make sure to check out bright's comment below about replacing the generic icon with MonoDevelop's.

  1. 打开 AppleScript 编辑器并输入以下内容:

    do shell script "open -n /Applications/MonoDevelop.app/"

  2. 使用“MonoDevelop Launcher”之类的名称保存,并确保为文件格式指定应用程序

  3. 将图标拖到 Dock 上。

  4. 请务必查看下面关于用 MonoDevelop 替换通用图标的 Bright 评论。

Click repeatedly to enjoy the grooviness of multiple MonoDevelop instances.

重复单击以享受多个 MonoDevelop 实例的精彩。

回答by Rory Blyth

For convenience, I just create three copies of MonoDevelop.

为方便起见,我只创建了 MonoDevelop 的三个副本。

Highlight MonoDevelop in Finder, copy, paste, rename the new copy to "MonoDevelop-2", and repeat to your satisfaction.

在 Finder 中突出显示 MonoDevelop,复制、粘贴,将新副本重命名为“MonoDevelop-2”,并重复到您满意为止。

It also helps me keep track of what's going on in different instances. I typically keep my most important project open in "MonoDevelop", use "MonoDevelop-2" for testing ideas related to my main project, and "MonoDevelop-3" for random scratch.

它还可以帮助我跟踪不同情况下发生的情况。我通常在“MonoDevelop”中打开我最重要的项目,使用“MonoDevelop-2”来测试与我的主要项目相关的想法,并使用“MonoDevelop-3”进行随机划痕。

When you alt-tab (open-Apple-tab (command-tab (whvr))), the name of the executable shows up beneath its icon in the application list, so, as long as I stick to my convention, I always know(ish) the contents of the instance I'm alt-tabbing to regardless of how many other app windows I have open. I don't have to cycle through them to figure it out.

当你 alt-tab (open-Apple-tab (command-tab (whvr))) 时,可执行文件的名称显示在应用程序列表中它的图标下方,所以,只要我坚持我的约定,我总是知道(ish) 无论我打开了多少个其他应用程序窗口,我都使用 alt-tab 键切换到的实例的内容。我不必通过它们循环来弄清楚。

It's not perfect - when I have "MonoDevelop" running, if I try to fire up one of the others, the first attempt to start will fail. You just try to fire it up again - it works the second time. This has only been happening since the most recent build, though, and I think it might have something to do with automatic updates or add-in management. Haven't looked into it too much. Since there are no problems once up and running, I don't worry about it :)

这并不完美 - 当我运行“MonoDevelop”时,如果我尝试启动其他一个,则第一次尝试启动将失败。您只需尝试再次启动它 - 它第二次起作用。不过,这只是自最近一次构建以来才发生的,我认为这可能与自动更新或加载项管理有关。没仔细研究过。因为一旦启动并运行就没有问题,所以我不担心:)

The result is that, with the start-it-twice method, for any additional instance of MonoDevelop you'd like to start, you end up having to quadruple-click instead of double-click. Adds about fifteen seconds to the process, and since I have MonoDevelop (along with "MonoDevelop-1" and "MonoDevelop-2") running all the time, it adds up to, maybe, an extra thirty seconds of work each week. A fair trade for the convenience, methinks.

结果是,使用 start-it-twice 方法,对于您想要启动的任何其他 MonoDevelop 实例,您最终必须四次单击而不是双击。为该过程增加了大约 15 秒,并且由于我一直运行 MonoDevelop(以及“MonoDevelop-1”和“MonoDevelop-2”),因此每周可能会增加 30 秒的工作时间。我想,这是为了方便而进行的公平交易。

A bit hacky, but it's worked well for me.

有点hacky,但对我来说效果很好。

And all the cool kids are doing it.

所有很酷的孩子都在这样做。

回答by Denis Gordin

Also you can use shorter version:

您也可以使用较短的版本:

Open -n -a "Xamarin Studio.app"

Edit: For Visual Studio for Mac and/or more shorter the command is

编辑:对于 Visual Studio for Mac 和/或更短的命令是

Open -n -a "Visual Studio"

回答by Glinkot

--XAMARIN STUDIO--

--XAMARIN 工作室--

As at February 2013 Monodevelop is called Xamarin Studio, and the fact it has a space in it means the above doesn't work. Some fiddling later, I've found you need to nest two types of quotes and the below will work in applescript:

截至 2013 年 2 月,Monodevelop 被称为 Xamarin Studio,事实上它有一个空间意味着上述不起作用。稍后一些摆弄,我发现你需要嵌套两种类型的引号,下面将在applescript中工作:

do shell script "open -n '/Applications/Xamarin Studio.app/'"

Enjoy

享受

回答by willem

If you're ok with opening two solutionsin one instanceof Xamarin Studio, you can do this by navigating to "File" -> "Recent Solutions" and then Ctrl+clicking on the other solution. This opens both solutions in the same instance of Xamarin studio.

如果您可以在Xamarin Studio 的一个实例中打开两个解决方案,则可以通过导航到“文件”->“最近的解决方案”,然后按住 Ctrl 键并单击另一个解决方案来执行此操作。这将在 Xamarin Studio 的同一实例中打开两个解决方案。

回答by valdetero

You can check out this app by redth (now a Xamarin employee) who made a Xamarin Studio Launcher: http://redth.codes/Xamarin-Studio-Launcher-v3/. There is no code to post since it is an app. But the good thing is it is packaged up in a .dmg for you. It even works with .sln files. Hard link to the v4 (Jan 12, 2015) download: http://redth.codes/assets/Xamarin.Studio.Launcher.v4.zip.

您可以通过制作 Xamarin Studio Launcher 的 redth(现在是 Xamarin 员工)查看此应用:http://redth.codes/Xamarin-Studio-Launcher-v3/ 。没有代码可以发布,因为它是一个应用程序。但好消息是它为您打包在 .dmg 中。它甚至适用于 .sln 文件。v4(2015 年 1 月 12 日)下载的硬链接:http: //redth.codes/assets/Xamarin.Studio.Launcher.v4.zip

回答by Geoffrey Huntley

Edit your ~/.bashrc or ~/.zshrc and configure the following shortcut:

编辑您的 ~/.bashrc 或 ~/.zshrc 并配置以下快捷方式:

alias xam = 'open -n /Applications/Xamarin\ Studio.app'

Use as follows from the CLI:

在 CLI 中使用如下:

xam ReactiveUI.sln

回答by Pritish

One more easiest way....

一种更简单的方法......

Just Open the Terminal Drag the Xamarin Studio app from application it will take the path like /Applications/Xamarin\ Studio.appand write the open -n before the /Applications/Xamarin\ Studio.app

只需打开终端从应用程序中拖动 Xamarin Studio 应用程序,它将采用类似的路径/Applications/Xamarin\ Studio.app并在之前写入 open -n/Applications/Xamarin\ Studio.app

Now complete command is like open -n /Applications/Xamarin\ Studio.app

现在完整的命令就像 open -n /Applications/Xamarin\ Studio.app

回答by Patel Pankaj

Just Open the Terminal write or below command , you can change instance name number e.g(/Xamarin\ Studio1) it's open another one Xamarin Studio , e.g(/Xamarin\ Studio1)

只需打开终端写入或下面的命令,您可以更改实例名称编号 eg(/Xamarin\ Studio1) 它打开另一个 Xamarin Studio , eg(/Xamarin\ Studio1)

$ open -na /Applications/Xamarin\ Studio.app --args -DataPath /Users/$(whoami)/Library/Application\ Support/Xamarin\ Studio1

Using above you can create any of .app multiple instance .

使用上面你可以创建任何 .app 多实例。