-
Notifications
You must be signed in to change notification settings - Fork 324
Support running emulators when running in remote/container environments #3315
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Can you confirm exactly what the setup here is? If you're using Remote Containers, then the extension code is all running on the remote machine. Launching an emulator on a remote machine usually doesn't make much sense (as remote machines tend to not be able to interact with the local desktop). Are you running something that would allow an Android emulator launched inside the remote to be visible to you on the local machine? Can you also confirm which device you're expecting to see but don't? In the log it looks like a device named Thanks! |
Sorry, I re-read and see you already mentioned "foobar" was the correct one. Can you confirm if you have a I've pushed a change (d79716b) that might improve the logging when this occurs that'll be in the upcoming release otherwise, which might help understand what's failing. |
I'm using the Remote Containers extension, but the container is actually run on my local machine.
Indeed! This is possible thanks to parameters passed to the The The This solution allows me to start and use the emulator without any host dependency.
Yes. 👍
The {
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Flutter (Debug)",
"request": "launch",
"type": "dart",
"flutterMode": "debug"
},
{
"name": "Flutter (Release)",
"request": "launch",
"type": "dart",
"flutterMode": "release"
}
]
}
Actually I was a bit curious and tried to look at the source code and possible causes. My bet is that Dart-Code/src/shared/vscode/device_manager.ts Lines 406 to 408 in 1ea85d8
Dart-Code/src/shared/vscode/utils.ts Lines 20 to 24 in 1ea85d8
I was thinking that maybe adding |
Ah, good spot - I'm not sure how I overlooked that when checking 🙈
I don't think that's an ideal fix, as this change was specifically to try and hide them where they might not work (eg. where you can't see the interactive processes launched in the container/remote). I think it may be better to have an enum setting similar to What do you think? |
Yes, you are right. Better not to try to guess the configuration, there will surely be other special cases. It's easier to be explicit. An additional parameter would solve the problem perfectly! 👍 |
There's a beta version with the changes in here if you'd like to test it out before release: https://github.com/Dart-Code/Dart-Code/releases/tag/v3.23.0-beta.1 If anything doesn't work as expected, please let me know! |
@DanTup Just installed the beta and tried the new settings parameter: it works like a charm now! Thanks again. 🎉 |
Great, thanks for confirming! :-) |
Is there an example repo of remote Android emulator for Flutter in Codespaces? |
@pedro-gilmora the issue was for the case where emulators launched in the "remote" were visible on the desktop. I don't think this is possible on Codespaces. However, if you have a remote Android emulator then in theory you can |
Describe the bug
Hi!
I'm using the Remote - Containers extension with the Flutter' one on Linux. I can successfully configure Flutter, create an emulator, launch it, and run my application.
The problem: when I press
F5
the existing device is not listed and there is no "Create Android emulator" option.Also, when I press
Ctrl
+Shift
+P
and search for "Flutter: Launch Emulator" there is no such command.Note that if I create the emulator with
flutter emulators --create
and then start it withflutter emulators --launch
then I'm able to run my application usingF5
and it's working perfectly fine. However, the Flutter extension won't mention the device if it is not launched, even after restarting VSCode (although it's somehow detected by the Flutter daemon according to logs below).To Reproduce
Remote Development
VSCode extensionDockerfile
to configureRemote - Containers
extension (important:KVM_GID
needs to be modified):devcontainer.json
to configureRemote - Containers
extension:Remote - Containers
extension to build and open your local project in a Docker container.F5
and notice there is no device listed.Expected behavior
When pressing F5, the
"foobar"
device should be listed and there should be a "Create Android device" option.The "Flutter: Launch Emulator" command should also be available.
Screenshots
No screenshots but some outputs.
Versions:
The text was updated successfully, but these errors were encountered: