Skip to content

Commit b1ce863

Browse files
Leland-Takaminegitbook-bot
authored andcommitted
GITBOOK-422: change request with no subject merged in GitBook
1 parent 4200334 commit b1ce863

File tree

1 file changed

+20
-147
lines changed

1 file changed

+20
-147
lines changed

getting-started/installing-maestro/windows.md

+20-147
Original file line numberDiff line numberDiff line change
@@ -4,163 +4,36 @@ description: A step by step guide to installing Maestro on Windows
44

55
# Windows
66

7-
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.
7+
{% stepper %}
8+
{% step %}
9+
### Download the latest Maestro Release
810

9-
### Pre-Requisites
11+
{% embed url="https://github.com/mobile-dev-inc/maestro/releases/latest/download/maestro.zip" %}
12+
{% endstep %}
1013

11-
1. PowerShell is installed in your Windows system.
12-
2. Install Android Studio on your Windows machine.
13-
3. Add ANDROID\_HOME to your Windows environment variable.
14-
1. To check if your ANDROID\_HOME setup is correctly done, open a PowerShell terminal and run this command `adb --version.`
15-
2. Note down the ADB version.
16-
4. Install Java JDK 11 and set JAVA\_HOME
17-
1. Run `java --version` to check if the Java is installed correctly.
14+
{% step %}
15+
### Extract the Maestro zip
1816

19-
## Steps <a href="#8b4a" id="8b4a"></a>
17+
Extract the zip file you downloaded in the previous step to any location. For instance:
2018

21-
1. Install WSL2 (Window Subsystem for Linux)
22-
2. Install Java 21
23-
3. Install Maestro
24-
25-
## 1. Install WSL 2 <a href="#0215" id="0215"></a>
26-
27-
With recent Windows 11, Microsoft has made it pretty easy to install Windows Subsystem for Linux, aka WSL.
28-
29-
In order to install WSL, open PowerShell as administrator and run the following command:
30-
31-
```bash
32-
wsl --install
33-
```
34-
35-
After running the above command, follow through instructions and restart the computer.
36-
37-
Install [Windows Terminal](https://github.com/microsoft/terminal) application for refreshing terminal experience.
38-
39-
Set your Linux username and password (Something that you will not forget).
40-
41-
Run the following two commands to update your Ubuntu system. Enter password when prompted.
42-
43-
```bash
44-
sudo apt update
45-
sudo apt upgrade
4619
```
47-
48-
## 2. Install Java <a href="#5521" id="5521"></a>
49-
50-
After restarting the system, open the Terminal application and click on the dropdown to select Ubuntu. Type in the following command:
51-
52-
```bash
53-
sudo apt install openjdk-21-jdk
20+
C:\Users\jake\maestro
5421
```
22+
{% endstep %}
5523

56-
## 3. Install Maestro
24+
{% step %}
25+
### Update your PATH environment variable
5726

58-
Installing Maestro is now just a matter of running following one command.
27+
Update your PATH environment variable to include the `maestro\bin` folder.
5928

6029
```
61-
curl -Ls "https://get.maestro.mobile.dev" | bash
62-
```
63-
64-
**Tada! 🎉**
65-
66-
**You have successfully installed Maestro on your Windows machine** 🙌
67-
68-
Check your Maestro version using the following command:
69-
70-
```bash
71-
maestro --version
30+
setx PATH "%PATH%;C:\Users\jake\maestro\bin"
7231
```
32+
{% endstep %}
7333

74-
## What's Next? <a href="#7639" id="7639"></a>
75-
76-
### Let's set you up to use Android in your freshly installed WSL2
77-
78-
* Download the Android command line tools zip file from [Android official site.](https://developer.android.com/studio)
79-
* Use the following instructions to set up Android command lines correctly in your WSL2.
34+
{% step %}
35+
### Connect to a device
8036

81-
* Open WSL2 terminal.
82-
* Create a new directory in your home directory.
83-
84-
```
85-
~ $ mkdir Android
86-
~ $ cd Android
87-
```
88-
89-
* Unzip the Android command line tools zip file in the `android` directory using this command: `unzip ~<command_line_zip_filename>.zip`
90-
* In the `Android` directory perform following actions.
91-
92-
```
93-
$ mkdir latest
94-
$ mv cmdline-tools/* latest/
95-
$ mv latest/ cmdline-tools/
96-
```
97-
98-
**Note:** Last command will probably give you a warning, but you don’t need the worry about that.
99-
100-
* Now add the following line to your `~/.bashrc file`
101-
102-
```
103-
export ANDROID_HOME=$HOME/Android
104-
export PATH=$PATH:$ANDROID_HOME/cmdline-tools/latest/bin
105-
```
106-
107-
* Save your `~/.bashrc` file and exit.
108-
* Run `source ~/.bashrc` to reload the bashrc file.
109-
* Now, we will install basic Android utilities using the following commands:
110-
* Run `sdkmanager --list` to check if everything is working fine.
111-
* Run `sdkmanager --install "platform-tools"` to install platform tools.
112-
* Finally, add the following into your `~/.bashrc` file
113-
* `export PATH=$PATH:$ANDROID_HOME/platform-tools`
114-
* Save your `~/.bashrc` file and exit.
115-
* Run `source ~/.bashrc` to reload the bashrc file.
116-
* To check that everything went well, do the following:
117-
* Close and relaunch terminal
118-
* Run `adb --version` and see that adb version is shown
119-
* Since 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.
120-
121-
**Please follow the below steps to setup the ADB and make sure you are able to use Android emulators with your WSL2 correctly**
122-
123-
* Fire up your Android emulator on Windows.
124-
* Once the Android emulator is up and running, open a PowerShell prompt.
125-
* Run this command in PowerShell
126-
127-
```
128-
adb -a -P 5037 nodaemon server
129-
```
130-
131-
* This will start the adb server in the Windows host.
132-
* Note down the IPV4 address of your Windows host PC/machine.
133-
134-
**TROUBLESHOOTING:**
135-
136-
* Sometimes you may get `smartsockets..` error when you run `adb -a -P 5037 nodaemon server` command in PowerShell. In that case, you can do the following steps:
137-
* Open task manager and kill all `adb` related processes.
138-
* If Android Studio is open, close it and **keep only** emulator running.
139-
* If you see a message saying `emulator offline`, **ignore it**.
140-
* 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.
141-
* **Note: Don't close the PowerShell terminal!**
142-
* **Now open your WSL2 terminal and run these commands.**
143-
* `adb kill-server`
144-
* `export ADB_SERVER_SOCKET=tcp:<WINDOWS_IPV4_ADDR>:5037`
145-
* `adb devices`
146-
* `You should see your connected emulator successfully now.`
147-
148-
### Ready to start Using Maestro?
149-
150-
Yes, at this point, you are free to start your automation.
151-
152-
* [Write your first flow](https://maestro.mobile.dev/getting-started/writing-your-first-flow)
153-
* How to run **Maestro commands**?
154-
* You can run Maestro commands in WSL2 terminal with `--host` flag. eg.
155-
* _**maestro --host \<WINDOWS\_IPV4\_ADDR> test flow.yaml**_
156-
* _**maestro --host \<WINDOWS\_IPV4\_ADDR> studio**_
157-
* Check out the [full documentation](https://maestro.mobile.dev/)
158-
159-
## Known Issue <a href="#2884" id="2884"></a>
160-
161-
```
162-
If your Android emulator is not up and running in the Windows host, the Maestro test
163-
command fails to find the installed emulator.
164-
At this point, it is recommended that you fire up your emulator before running the flow
165-
using Maestro.
166-
```
37+
`maestro test` will automatically detect and use any local emulator or USB-connected physical device.
38+
{% endstep %}
39+
{% endstepper %}

0 commit comments

Comments
 (0)