emulator icon indicating copy to clipboard operation
emulator copied to clipboard

[WSL] Extension finds emulators but does not manage to start them, but the provided command does start the emulator.

Open 0tii opened this issue 4 months ago • 0 comments

Installed the Android SDK etc under Windows. Running VSCode in WSL.

The path provided to the extension settings:

/mnt/c/Users/<user>/AppData/Local/Android/Sdk/emulator

In order for WSL to run the emulators, I have also made a copy of emulator.exe to emulator in the .../Sdk/emulator directory.

Extension returns this error:

Something went wrong running you Android emulator! Try running this command in your terminal: 
/mnt/c/Users/<user>/AppData/Local/Android/Sdk/emulator/emulator -avd Pixel_4

However running the provided command manually in the console does start the emulator successfully, making me wonder how the extension doesnt manage to start the emulator, when the command it provides does.

Furthermore, I created a minimal working example in plain js to run the provided command:

const exec = require('child_process').exec;

const cmd =
  '/mnt/c/Users/Daniel/AppData/Local/Android/Sdk/emulator/emulator -avd pixel_4';

exec(cmd);

and it perfectly opens the emulator ...

Additional information

It does find my emulators so the list-avds command seems to execute properly emulators

Error ouput when trying to start devicce image

0tii avatar Feb 29 '24 09:02 0tii