大多数情况下,当您在Mac 和 Android 设备(Mac and Android devices)上安装应用程序时,该应用程序只允许您在该设备上一次使用一个帐户。当您只拥有该应用程序的一个帐户时,这很好用。但是,当您有多个帐户并且希望在同一设备上同时使用它们时,就会出现问题。
一种方法是运行应用程序的多个实例。默认情况下,您的设备不(device doesn)提供执行此操作的选项,但有一种解决方法可以实现。
使用终端运行同一应用程序的多个副本 (Mac)(Use Terminal To Run Multiple
Copies Of The Same App (Mac))
在
Mac 机器上(Mac machine),终端应用程序(Terminal app)允许您使用各种命令执行许多任务。它包含一个命令,允许您在计算机上运行应用程序的两个或多个实例。
这样,您可以多次启动应用程序,每次都有自己独立的容器。每个实例都将与其他实例隔离,因此不会有任何混淆。
这是你如何做到的。
- 从 Launchpad启动终端应用程序。(Terminal)
- 当终端(Terminal)启动时,输入以下命令,按空格键(Spacebar),从Applications文件夹中拖放您的Mac 应用程序,然后(Mac app)按 Enter 键(Enter)。打开-n(open -n)
- 例如,我将在我的Mac上启动(Mac)Calculator 应用程序(Calculator app)的两个实例。我将输入以下命令并按(command and hit)Enter 键(Enter)。open -n /Applications/Calculator.app
- 该命令将在您的Mac上打开您(Mac)选择(chosen app)的应用程序的一个实例。多次运行该命令以在您的计算机上启动该应用程序的多个实例。
使用 AppleScript 启动同一应用程序的多个实例(Launch Multiple Instances Of
The Same App Using AppleScript)
Terminal 方法(Terminal method)工作得很好,但该
方法的主要缺点是每次要启动应用程序实例时都需要运行命令。
如果您经常需要同时运行一个应用程序的多个实例,那么使用
终端(Terminal)执行任务可能不是理想的方式。
幸运的是,您的Mac允许您运行预定义的脚本,您只需双击桌面上的图标即可使用此功能运行应用程序的多个实例。这就像通常在您的机器上启动应用程序一样简单。
在 Mac 上打开Launchpad并选择Other,然后选择Script Editor。它将启动AppleScript 编辑器(AppleScript editor)应用程序。
单击文件(File),然后单击新建(New)以创建新应用程序。在应用程序中输入以下代码,将APP-PATH替换(app replacing) 为您的 Mac 应用程序的路径。执行shell脚本“open -n APP-PATH”(do shell script “open -n APP-PATH”)
计算器应用程序(Calculator app)的命令将如下所示。
do shell script “open -n /Applications/Calculator.app”
单击脚本(Script)菜单并选择编译(Compile)以编译代码。
按Command + S保存脚本。输入脚本的名称,从File Format菜单中选择Application ,然后点击(Application)Save。
现在,当您想要运行应用程序的多个实例时,只需双击您刚刚保存的脚本,它就会为您完成任务。您可以为任何应用程序创建脚本,因为它只需要输入您机器上应用程序的路径即可。
使用并行空间运行应用程序的多个实例 (Android)(Run Multiple Instances Of An
App Using Parallel Space (Android))
与Mac相比,在(Mac)Android 设备(Android device)上运行应用程序的多个实例的能力更有用。原因是您可以在设备上同时使用不同的电话号码运行您最喜欢的即时通讯应用程序(messaging apps),例如WhatsApp 和 Viber 。(WhatsApp and Viber)
Android上没有终端(Terminal),因此您需要从Google Play Store获取应用程序。该应用程序称为Parallel Space。
安装并启动应用程序,然后浏览欢迎屏幕。出现主屏幕时,选择您要克隆的应用程序,然后点击底部的添加到并行空间。(Add to Parallel Space)
点击以下屏幕上的应用程序图标并授予所需的权限。
该应用程序将启动,就好像这是您第一次在设备上使用它一样。
在 Android 上使用 2Accounts 打开应用程序的两个实例(Open Two Instances Of An App
Using 2Accounts On Android)
如果Parallel Space 应用程序(app didn)由于某种原因无法为您工作,那么您还有另一个出色的应用程序可以帮助您创建应用程序的多个实例。
输入2Accounts ,它可以让您做与(2Accounts)Parallel Space 应用程序(Parallel Space app)完全相同的事情。
从官方Google Play 商店(Google Play Store)获取应用程序并将其安装在您的设备上。
打开应用程序,选择您要运行多个实例的应用程序,然后点击底部的启用。(Enable)
在以下屏幕上点击您的应用程序,它的一个实例将在您的设备上启动。
您现在可以将其他帐户添加到新创建的应用程序实例中并立即开始使用它们。
如果您不再需要某个应用程序的实例,只需在上述任一应用程序中点击并按住该应用程序,然后选择(apps and select) 删除(Delete)。它将从您的设备中删除该实例以及相关文件。
How To Run Multiple Instances Of An App On Android & Mac
Most of the time when you install an app on your Maс and Android devices, the app only allows you to use one account at a tіmе on that device. This works juѕt fine when you only hold a single account with that app. But the problem arises when you have mυltiple accountѕ and you wish to use them all at the same time on the same device.
One
of the ways to do that is to run multiple instances of the app. By default,
your device doesn’t offer the option to do this but there is a workaround to
make it happen.
Use Terminal To Run Multiple
Copies Of The Same App (Mac)
On a
Mac machine, the Terminal app lets you perform a number of tasks using various
commands. It includes a command that allows you to run two or more instances of
an app on your machine.
That
way, you can launch an app multiple times, each with their own independent
container. Each instance will be isolated from the others so there won’t be any
mixing up of anything.
Here’s
how you do it.
- Launch the Terminal app from the Launchpad.
- When Terminal launches, type in the following command, press the Spacebar, drag and drop your Mac app from the Applications folder, and hit Enter.
open -n
- As an example, I’m going to launch two instances of the Calculator app on my Mac. I would type in the following command and hit Enter to do so.
open -n /Applications/Calculator.app
- The command will open an
instance of your chosen app on your Mac. Run the command multiple times to
launch multiple instances of that app on your machine.
Launch Multiple Instances Of
The Same App Using AppleScript
The
Terminal method works just fine but the main drawback of the method is that you
need to run the command each time you want to launch an instance of an app.
If
you often need multiple instances of an app running at the same time, using
Terminal to do the task may not be the ideal way.
Fortunately, your Mac lets you run predefined scripts and you can use this feature to run multiple instances of an app by just double-clicking on an icon on your desktop. It’s as easy as normally launching an app on your machine.
Open Launchpad on your Mac and select Other followed by Script Editor. It’ll launch the AppleScript editor app.
Click on File followed by New to create a new app. Enter the following code in the app replacing APP-PATH with the path of your Mac app.
do shell script “open -n APP-PATH”
The command will look like the following for the Calculator app.
do shell script “open -n /Applications/Calculator.app”
Click on the Script menu and select Compile to compile the code.
Press Command + S to save the script. Enter a name for the script, select Application from the File Format menu, and hit Save.
Now
whenever you want to run multiple instances of an app, simply double-click on
the script you’ve just saved and it’ll do the task for you. You can create the
script for any of your apps as all it requires as an input is the path of the
app on your machine.
Run Multiple Instances Of An
App Using Parallel Space (Android)
Compared to Mac, the ability to run multiple instances of an app on an Android device is more useful. The reason is because you can run your favorite instant messaging apps like WhatsApp and Viber with different phone numbers at the same time on your device.
There’s no Terminal on Android so you’ll need to grab an app from the Google Play Store. The app is called Parallel Space.
Install and launch the app, then go through the welcome screens. When the main screen appears, choose the app you’d like to clone and tap on Add to Parallel Space at the bottom.
Tap on the app icon on the following screen and grant the required permissions.
The app will launch as if it’s the first time you’ve used it on your device.
Open Two Instances Of An App
Using 2Accounts On Android
If
the Parallel Space app didn’t work for you for some reason, you have another
great app to help you create multiple instances of your apps.
Enter 2Accounts, that lets you do the exact same thing as the Parallel Space app.
Grab the app from the official Google Play Store and install it on your device.
Open the app, choose the app you’d like to run multiple instances of, and tap on Enable at the bottom.
Tap on your app on the following screen and an instance of it will launch on your device.
You
may now add your additional accounts to the newly created instance of the app
and start using them right away.
If
you no longer need an instance of an app, simply tap and hold on the app in
either of the above apps and select Delete.
It will delete the instance along with the associated files from your device.