Android development workflow for Neovim
Build, run, and debug Android apps directly from Neovim.
- 🚀 One-Command Workflow - Build → Install → Launch → Logcat with
:DroidRun - 📱 Smart Device Management - Auto-detect devices/emulators
- 📋 Real-time Logcat - Filter by package, tag, log level, and patterns
- 🔧 Gradle Integration - Build, clean, sync with automatic
gradlewdetection - ⚙️ Flexible Windows - Horizontal, vertical, or floating displays
- 🎯 Simple Configuration - Minimal setup required
Requirements: Neovim 0.10+, Android SDK with adb in PATH
-- lazy.nvim
{
"rrxxyz/droid-nvim",
config = function()
require("droid").setup()
end,
}Optional Configuration:
require("droid").setup({
logcat = {
mode = "horizontal", -- "horizontal" | "vertical" | "float"
height = 15,
filters = {
package = "mine", -- "mine" (auto-detect) or specific package
log_level = "d", -- v, d, i, w, e, f
},
},
android = {
auto_launch_app = true, -- Launch app after install
qt_qpa_platform = "xcb", -- Linux: "xcb" or "wayland"
},
})| Command | Description |
|---|---|
:DroidRun |
Build → Install → Launch → Logcat |
:DroidLogcat |
Show logcat for selected device |
:DroidBuildDebug |
Build debug APK only |
:DroidInstall |
Install APK without launching |
:DroidDevices |
Show available devices/emulators |
:DroidEmulator |
Start emulator from AVD list |
| Command | Description |
|---|---|
:DroidClean |
Clean project |
:DroidSync |
Sync dependencies |
:DroidTask <task> |
Run custom Gradle task |
| Command | Description |
|---|---|
:DroidLogcatFilter log_level=d |
Show debug level and above |
:DroidLogcatFilter tag=MyTag |
Filter by specific tag |
:DroidLogcatFilter package=mine |
Show only your app's logs |
:DroidLogcatFilter grep=Exception |
Filter by text pattern |
Combine filters: :DroidLogcatFilter tag=MyTag log_level=d
-- Recommended keybindings
vim.keymap.set("n", "<leader>ar", ":DroidRun<CR>", { desc = "Run Android app" })
vim.keymap.set("n", "<leader>al", ":DroidLogcat<CR>", { desc = "Open logcat" })
vim.keymap.set("n", "<leader>ab", ":DroidBuildDebug<CR>", { desc = "Build debug APK" })
vim.keymap.set("n", "<leader>ae", ":DroidEmulator<CR>", { desc = "Launch emulator" }):DroidRun- Build, install, launch, and show logcat:DroidLogcatFilter package=mine log_level=d- Focus on your app:DroidLogcatFilter tag=MyActivity- Filter specific components- Make code changes and repeat
" Build and test
:DroidRun " Full workflow
:DroidTask assembleRelease " Build release
:DroidTask testDebugUnitTest " Run tests
" Logcat filtering
:DroidLogcatFilter package=mine " Show only your app
:DroidLogcatFilter log_level=e " Errors only
:DroidLogcatFilter grep=Exception " Find exceptionsThe plugin auto-detects your Android SDK from:
ANDROID_SDK_ROOTorANDROID_HOMEenvironment variablesvim.g.android_sdk(manual override)- Platform defaults (
~/Library/Android/sdk,/opt/android-sdk, etc.)
- Executable
gradlewin project root:chmod +x gradlew - Android SDK with
adbin PATH - Connected device or running emulator
Set Qt platform for emulator compatibility:
require("droid").setup({
android = { qt_qpa_platform = "xcb" },
})| Issue | Solution |
|---|---|
| "gradlew not found" | Run chmod +x gradlew in project root |
| "Android SDK not found" | Set ANDROID_SDK_ROOT environment variable |
| "No devices available" | Connect device or start emulator |
| Emulator won't start (Linux) | Set qt_qpa_platform = "xcb" in config |
:messages " Check for errors
:DroidTask tasks " List Gradle tasks
:lua print(require("droid.android").get_adb_path()) " Check ADB pathLicense: MIT | Contributions: Welcome!