Maestro works great on Windows computers, but there are a few unique setup steps to be aware of. This guide will walk you through the end-to-end steps for getting started with Maestro on a Windows machine.
- 1.Powershell is installed in Windows system.
- 2.Install android studio in windows machine.
- 3.Add ANDROID_HOME to your windows environment variable.
- 1.To check if your ANDROID_HOME setup is correctly done, open a powershell terminal and run this command
- 2.Note down the adb version.
- 4.Install Java JDK 11 and set JAVA_HOME
java --versionto check if the java is installed correctly.
- 1.Install WSL2 (Window Subsystem for Linux)
- 2.Install Java 11
- 3.Install Maestro
With recent Windows 11, Microsoft have made it pretty easy to install Windows Subsystem For Linux aka WSL
In order to install WSL, open Powershell As Administrator and run following command:
After running the above command, follow through instructions and restart the computer.
Set your linux username and password (Something that you will not forget).
Run following 2 commands to update your Ubuntu system. Enter password when prompted.
sudo apt update
sudo apt upgrade
After restarting the system, open Terminal application and click on the dropdown to select Ubuntu. Type in following command:
sudo apt install openjdk-11-jdk
Installing Maestro is now just a matter of running following one command.
curl -Ls "https://get.maestro.mobile.dev" | bash
You have successfully installed Maestro in your Windows machine 🙌
Check your maestro version using following command
- Make sure you have ANDROID_HOME in your environment variable of WSL2 as well.
- To check that everything went good, do following:
- Close and relaunch terminal
adb --versionand see that adb version is shown
- Since everything is installed fresh, your WSL 2 adb version should perfectly match with windows adb version that we noted down as part of pre-requisites.
It's time to put some magical elixir and make sure you are able to use android emulators with your WSL2 correctly.
Please follow below steps to setup the bridge.
- Fire up your android emulator on windows.
- Once android emulator is up and running, open a POWERSHELL PROMPT.
- Run this command in Powershell
adb -a -P 5037 nodaemon server
- Keep the powershell windows open.
- Now open your WSL2 terminal and run these commands.
- You should see your connected emulator successfully now.
Yes at this point you are free to start your automation.
- How to run my flow?
- To run your flow run this command in your WSL2 terminal
maestro --host <WINDOWS_IPV4_ADDR> test flow.yaml
If your android emulator is not up and running in windows host, the maestro test
command fails to find installed emulator.
At this point it is recommended that you fire up emulator before running the flow