Windows
A step by step guide to installing Maestro on Windows
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.
Pre-Requisites
PowerShell is installed in your Windows system.
Install Android Studio on your Windows machine.
Add ANDROID_HOME to your Windows environment variable.
To check if your ANDROID_HOME setup is correctly done, open a PowerShell terminal and run this command
adb --version.
Note down the ADB version.
Install Java JDK 11 and set JAVA_HOME
Run
java --version
to check if the Java is installed correctly.
Steps
Install WSL2 (Window Subsystem for Linux)
Install Java 21
Install Maestro
1. Install WSL 2
With recent Windows 11, Microsoft has made it pretty easy to install Windows Subsystem for Linux, aka WSL.
In order to install WSL, open PowerShell as administrator and run the following command:
After running the above command, follow through instructions and restart the computer.
Install Windows Terminal application for refreshing terminal experience.
Set your Linux username and password (Something that you will not forget).
Run the following two commands to update your Ubuntu system. Enter password when prompted.
2. Install Java
After restarting the system, open the Terminal application and click on the dropdown to select Ubuntu. Type in the following command:
3. Install Maestro
Installing Maestro is now just a matter of running following one command.
Tada! 🎉
You have successfully installed Maestro on your Windows machine 🙌
Check your Maestro version using the following command:
What's Next?
Let's set you up to use Android in your freshly installed WSL2
Download the Android command line tools zip file from Android official site.
Use the following instructions to set up Android command lines correctly in your WSL2.
Open WSL2 terminal.
Create a new directory in your home directory.
Unzip the Android command line tools zip file in the
android
directory using this command:unzip ~<command_line_zip_filename>.zip
In the
Android
directory perform following actions.
Note: Last command will probably give you a warning, but you don’t need the worry about that.
Now add the following line to your
~/.bashrc file
Save your
~/.bashrc
file and exit.Run
source ~/.bashrc
to reload the bashrc file.Now, we will install basic Android utilities using the following commands:
Run
sdkmanager --list
to check if everything is working fine.Run
sdkmanager --install "platform-tools"
to install platform tools.
Finally, add the following into your
~/.bashrc
fileexport PATH=$PATH:$ANDROID_HOME/platform-tools
Save your
~/.bashrc
file and exit.Run
source ~/.bashrc
to reload the bashrc file.
To check that everything went well, do the following:
Close and relaunch terminal
Run
adb --version
and see that adb version is shownSince everything is installed fresh, your WSL 2 adb version should perfectly match with Windows ADB version that we noted down as part of the pre-requisites.
Please follow the below steps to setup the ADB and make sure you are able to use Android emulators with your WSL2 correctly
Fire up your Android emulator on Windows.
Once the Android emulator is up and running, open a PowerShell prompt.
Run this command in PowerShell
This will start the adb server in the Windows host.
Note down the IPV4 address of your Windows host PC/machine.
TROUBLESHOOTING:
Sometimes you may get
smartsockets..
error when you runadb -a -P 5037 nodaemon server
command in PowerShell. In that case, you can do the following steps:Open task manager and kill all
adb
related processes.If Android Studio is open, close it and keep only emulator running.
If you see a message saying
emulator offline
, ignore it.Sometimes, the firewall stops your connection with the host machine. For that, add a firewall rule to allow the connection or check with your organization system admin if using a company machine.
Note: Don't close the PowerShell terminal!
Now open your WSL2 terminal and run these commands.
adb kill-server
export ADB_SERVER_SOCKET=tcp:<WINDOWS_IPV4_ADDR>:5037
adb devices
You should see your connected emulator successfully now.
Ready to start Using Maestro?
Yes, at this point, you are free to start your automation.
How to run Maestro commands?
You can run Maestro commands in WSL2 terminal with
--host
flag. eg.maestro --host <WINDOWS_IPV4_ADDR> test flow.yaml
maestro --host <WINDOWS_IPV4_ADDR> studio
Check out the full documentation
Known Issue
Last updated