I am stuck with an issue which I dont seem to find any way to fix it.
I have created a batch file to launch the android emulator
emulator -avd myEmulator -gpu swiftshader
adb wait-for-device
when I open cmd and run the batch file manually in my machine, I am able to launch the emulator.
Now, I have a Batch Task added in TFS which points to the above batch file in the repository.
Whenever I run the task, I see the below information
The emulator seems to be running in the backgroud because when I try and start the same emaulator manually when the build is running, it gives me the error Emulator is already running. How do I fix this. i want the emulator to launch and be visible. I didnot add any script to run in the background because if I run the batch file manually it seems to be working. Please help
Update:
As an interactive process with auto-logon enabled. In some cases, you might need to run the agent interactively for production use - such as to run UI tests. When the agent is configured to run in this mode, the screen saver is also disabled.
Try to run your build agent under Interactive mode. More details please refer our official doc here: Interactive vs. service
According to your description, TFS seems succeed creates and starts emulator in background, and waiting for full android loading on emulator.
To get a workaround, could you try to run the emulator directly on the build agent machine instead of your local machine.
You could setup your own agent and instance on a local machine that runs an emulator. Check if this do the trick.
It works when I run the emulator directly in the Build machine but what I want to acheive is to launch the emulator from the TFS task. I dont know why I am not able to see the running emulator oh btw this happens to my Chrome driver also, I am not running in a headless mode but still I dont see chrome launching in Build machine agent, But I see the TFS task starts Chrome driver session and performs all the operations.
@HussainSam How did you run your agent, Interactive or service? In some cases, you might need to run the agent interactively for production use - such as to run UI tests. When the agent is configured to run in this mode, the screen saver is also disabled. Try to run your build agent under Interactive mode. More details please refer this link: docs.microsoft.com/en-us/azure/devops/pipelines/agents/…
You are right, I ran the agent as a service. Thank you, It was hard for me to figure this out :p You are the legend :)