androidSdk/bin/emulator support#523
Conversation
|
@sidlatau sorry for the direct '@' -- only want to make sure this has been noticed :) would love to hear thoughts :) |
|
I like the use case here. Having an escape hatch for environments where require("flutter-tools").setup({
emulators = {
launcher = function(emulator, paths)
if emulator.system ~= "android" then
return nil
end
local emulator_bin = vim.fn.exepath("emulator")
if emulator_bin == "" then
return nil
end
local args = { "@" .. emulator.id, "-gpu", "host", "-accel", "on" }
if emulator.cold_boot then
table.insert(args, "-no-snapshot-load")
end
return {
command = emulator_bin,
args = args,
}
end,
},
})With that model:
|
|
Thanks for the feedback - all valid. as of right now this existing implementation solved my immediate problem, but the PR should include a more generalized solution for sure 😄 Let me take a stab at re-writing the implementation with your suggestions in mind and i'll get back to you. |
The WHY
For whatever reason my NixOS +
nix developshell which encapsulates my flutter project doesn't want to load qemu aka emulators into the Nvidia VRAM when launched viaflutter emualtor --launch emulator_id, but theemulator @emulator_id -gpu host -accel onworks like a charm.The intention of the Draft PR is to gauge whether this affects other people and could be useful to a wider audience 😄
There could be potential to capture user input to extend the launch options with the ones listed in
emulator --helpThis adds a rudimentary support for
**/*/androidSdk/bin/emulatorbinary.-gpu host,-accel onand others - currently hard-coded what i needed.emulatorbinaryemulator @emulator_id.. argsknown issues:
emulatorbinary is used to launch the emulators, on closing the emulator, the entire log is pushed to the Notifications. I'm not sure what would be the best way to handle thisprobablybreak on MacOS - haven't tested it there (i do have a mac so i will be able to test there soon)