Emulator Android


i would like to run test on emulator.
i use sdk avd android to create emulator
but when i start my emulator it doen’t have serial number ?
How i could set it ?
i need serial number to execute wptdriver.bat

Thanks in advance

When you run “adb devices” what does it list for the emulator? You should be able to run the agent without specifying a device ID but I’ve never tested it so it’s possible that somewhere along the line it’s failing when a device ID isn’t specified.

I can’t recommend against running tests inside of the emulator highly enough. It doesn’t perform anything like a real device and I’m guessing that video capture will also suck if it even works. Getting a cheap Moto E or G works a whole lot better, even for development.

thanks pmeeman

When i run adb devices i have this result : emulator-5554 device

i take this to my parameter serialNumber when i execute .bat file

but it doesn’t like “-”

I just would test on emulator, cause at this time i don’t have any real device, so before i would try on emulator just to verify if all is running well

oh i see that my emulator android wasn’t detected…
when i check
that tell me my android isn’t connected

The node agent will not poll for work until it can talk to the device and the server will not show an agent as connected until it polls for work so it all goes back to not being able to configure adb to not require a serial number for a device right now.

So i can’t run test on emulator ?

Not without fixes to the code. I’m out this week for Velocity so I probably won’t get a chance to look at it until next week - though pull requests are always welcome if you want to take a crack at it.

ok, had a few minutes to try it out and it turns out to be a super-easy fix: https://github.com/WPO-Foundation/webpagetest/commit/a940f5d5fe593d203ed15bca6e51a933192f1022

It’s just a 2-character change to the regex check for device ID’s to allow the - that is part of the emulator ID’s.

I looked at allowing running without device ID’s but it didn’t work on my first attempt and I don’t have time to look closer right now but the patch above should get you working.