LinuxCommandLibrary

anbox

Run Android applications in Linux environment

TLDR

Launch Anbox into the app manager

$ anbox launch --package=[org.anbox.appmgr] --component=[org.anbox.appmgr.AppViewActivity]
copy

SYNOPSIS

anbox command [options]

PARAMETERS

help [command]
    Show general or specific command help

version
    Print Anbox version information

session-manager [options]
    Start/manage Android session. Options: --android-image=path, --data-partition-size=size, --sdcard-size=size, --enable-audio, --enable-graphics, --vbox

appmgr [options]
    Manage apps. --action=install|uninstall|list-installed|list-running --package=name --apk=path

launch [options]
    Launch app. -p|--package=name -c|--component=name [-a|--action] [-i|--category]

shell [command]
    Run shell or command in Android container

wait-for-service address [options]
    Wait for service. --timeout=seconds

DESCRIPTION

Anbox (Android in a Box) enables running a full Android system on GNU/Linux without emulation. It leverages container technologies like namespaces, cgroups, binder, and ashmem from the Linux kernel to provide a compatibility layer, allowing Android apps to run with near-native performance directly on the host.

The anbox command-line tool is the main interface for controlling Anbox. Key functions include starting the Android session manager, which boots the containerized system; installing APK files; launching apps that integrate into the Linux desktop via a window manager bridge; listing or uninstalling packages; and accessing an interactive shell inside the container. Users must prepare an Android image (e.g., from AOSP), ensure kernel support for required modules, and handle graphics/audio passthrough.

Anbox shines for developers testing Android apps on Linux desktops but requires setup for hardware acceleration and may face compatibility issues with newer Android versions. It's lightweight compared to full emulators like Android Studio's AVD.

CAVEATS

Requires binder_linux and ashmem_linux kernel modules (may need custom kernel or root). No active development since 2021; use Waydroid for modern alternative.
Graphics integration needs Wayland/X11 bridge; some apps incompatible.

SETUP ESSENTIALS

Install via snap: snap install --devmode --beta anbox. Load modules: sudo modprobe binder_linux ashmem_linux. Download Android image to ~/.local/share/anbox.

USAGE EXAMPLE

anbox session-manager &
anbox appmgr --action=install --apk=app.apk
anbox launch -p com.android.settings

HISTORY

Developed from 2016 by community (led by morf); Genymobile sponsorship 2019-2021. Open-source under GPL-3.0; main repo archived Jan 2021 due to maintainer capacity limits.

SEE ALSO

lxc(1), systemd-run(1), modprobe(8)

Copied to clipboard