dimaportenko / telescope-simulators.nvim

A telescope.nvim extension to open iOS simulators and Android emulators.
90 stars 1 forks source link

Linux Not Supported #7

Open Burnsedia opened 8 months ago

Burnsedia commented 8 months ago

This Runs In my MacOS VM and My old MacBook and hackintosh but not on my Linux machines for my Android development. A possible fix is to configure the plugin to make the IOS Simulator or Android Emulator Optional.

dimaportenko commented 8 months ago

A possible fix is to configure the plugin to make the IOS Simulator or Android Emulator Optional.

this is already done, you can see the config in readme.

but not on my Linux machines for my Android development.

I have only a MacOS environment so it is built for it. Feel free to contribute a solution for Linux.

Burnsedia commented 8 months ago

I must have misconfigured the plugin. I figure out how to get it working Linux and give a pr, either for code or docs.

Burnsedia commented 8 months ago

@dimaportenko I misread the docs, I'll figure it out and open a pr to explain it to people using a different package manager.

dimaportenko commented 8 months ago

Cool, I'm waiting for your PR.

NullifiedValue commented 3 months ago

It's working on Linux (Pop! OS / Ubuntu) using Lazy.nvim for me, this is my config block:

{
    "nvim-telescope/telescope.nvim",
    tag = "0.1.5",
    dependencies = {
        "nvim-lua/plenary.nvim",
        "dimaportenko/telescope-simulators.nvim",
    },
    config = function()
        require("telescope").setup({
            extensions = {
                simulators = {
                    android_emulator = true,
                    apple_simulator = false,
                },
            },
        })

        -- simulators bind
        vim.keymap.set("n", "<leader>fs", function()
            vim.cmd(":Telescope simulators run")
        end)
    end,
}

It could also be it's own block separated from telescope, it's all taste and how compartmentalized you want it:

{
    "dimaportenko/telescope-simulators.nvim",
    dependencies = { "nvim-telescope/telescope.nvim" },
    config = function()
        require("simulators").setup({
            android_emulator = true,
            apple_simulator = false,
        })

        require("telescope").load_extension("simulators")

        vim.keymap.set("n", "<leader>fs", function()
            vim.cmd(":Telescope simulators run")
        end)
    end,
},

I installed Android Studio using flatpak and here's some tips for anybody:

  1. Add the folder containing the emulator executable to PATH export PATH="$PATH:/home/{USER}/Android/Sdk/emulator"
  2. Change ADV Location to flatpak's export ANDROID_AVD_HOME="/home/{USER}/.var/app/com.google.AndroidStudio/config/.android/avd"
  3. Validate by manually running command: emulator -list-avds, it shouldn't be empty

Cheers :coffee:

Sorry for the spam. I did further config refinement I got confused why :Telescope simulators wasn't working so I scrapped the whole thing.. obviously it's :Telescope simulators run... why? :raised_eyebrow:

dimaportenko commented 3 months ago

@NullifiedValue thanks for your input.

Sorry for the spam. I did further config refinement I got confused why :Telescope simulators wasn't working so I scrapped the whole thing.. obviously it's :Telescope simulators run... why? 🤨

No specific reason at the moment. But for the future, you may want to add alternative lists like booted device to close and there will be another command.