This note describes how to correctly select and run virtual machines (VMs) when working with ZennoDroid.
How does ZennoDroid work with virtual machines (VM)?
In case of random selection (when no name or index is specified in the Select action) ZennoDroid always selects a random VM that is not occupied at the moment.
If you want to manually select a machine, then you must control yourself so that different threads do not select the same machine at the same time.
Let's take an example:
there is a VM named
Memu_1and two projects,
Project2, that work with this VM.
Project1starts earlier and takes over VM
Memu_1to itself. Then
Project2is launched and "sees" that the VM is occupied.
It will wait 60 seconds and, if the VM is not free, it will fail. If, during these 60 seconds,
Project1gets free the VM, then the second project will “pick up” the VM and work with it.
The same will happen if the project is strictly specified to work with a specific VM and the project is launched in several threads - the thread that started earlier will take over the VM, and the second thread will show an error.
1. Selecting a virtual machine
First of all, you need to select the VM with which the current thread will work. You can do this using the Select action in the Virtual Machine action.
How to choose the right VM
The simplest option would be to randomly select a VM.
To do this, leave the “Full name or index” field empty in the Select action settings. And in the fields for the name and index, you need to specify the variables where the corresponding data will be saved.
With this approach, ZennoDroid searches among all available virtual machines that are not currently occupied.
A virtual machine that is selected by default in the settings is always considered occupied and ZennoDroid, if randomly selected, will skip it.
2. Running a virtual machine
After the VM has been selected, it needs to be started. To do this, use the Start\Restart action from the Virtual machine action article.