mobile-dev-inc / maestro

Painless Mobile UI Automation
https://maestro.mobile.dev/
Apache License 2.0
5.84k stars 276 forks source link

Maestro doesn't recognize an emulator even if 'adb devices' does #1039

Open Barbora827 opened 1 year ago

Barbora827 commented 1 year ago

I've been setting up Maestro on two Windows computers. On one of them, it works perfectly, but I have an issue on the other.

I finished the whole setup process and it seemed to work perfectly fine, with adb devices showing emulator-5554. However, when I try to run maestro test <filename> in the project folder, it doesn't recognize the emulator. If I specify the device in the command, it says that there is no "emulator-5554" device connected. This happens no matter if the app is running on the emulator or not.

Perhaps it's related, but I also noticed that every time I close WSL or Powershell or restart the PC, I have to re-do this sequence of the setup:

On Powershell:

On WSL:

I find this strange as this doesn't happen on the first computer - there this setup needed to be done only the first time. If I don't do this or quit Powershell and then run adb devices on WSL, it never outputs anything and gets stuck indefinitely.

imanishverma commented 1 year ago

@Barbora827 Yes, when you close Powershell or WSL you need to do that sequence of activities. Please do note the dynamic nature of IPV4. You can cross examine if your IPV4 may have changed and export the correct one to WSL.

On second issue where maestro test flow.yaml is not able to identify the emulator -- That is because you are not passing the --host flag. You should run your test like this image

bhamnoal commented 1 year ago

I was facing the same issue. Just take out the port of ipv4. Example: maestro --host 192.168.1.100 test android-flow.yaml instead of maestro --host 192.168.1.100:5037 test android-flow.yaml Hope it helps

HamAraAym commented 5 months ago

I have the same issue as well When I run adb.exe devices I can see the device image

But running maestro --host studio gives a no emulator running image

KratikaTimelyai commented 3 months ago

I have the same issue as well When I run adb.exe devices I can see the device image

But running maestro --host studio gives a no emulator running image

i have same issue could you please share solution

PabloJAndrade commented 2 months ago

I have the same issue as well When I run adb.exe devices I can see the device image But running maestro --host studio gives a no emulator running image

i have same issue could you please share solution

i had this problem, in my case i was using the android studio emulator. And I realized that when I left the full android studio open it used port 5037, so I closed it and left only the emulator open and I was able to run maestro normally. I tried running it through other ports, such as 5036 and 5038, but I couldn't connect to the device. i don't know why hahaha