Anbox

From ArchWiki
Revision as of 21:07, 13 December 2019 by F3fora (talk | contribs) (Small changes in paragraphs and subparagraphs names and orders)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Anbox is a free and open-source compatibility layer that aims to allow mobile applications and mobile games developed for Android to run on GNU/Linux distributions. It executes the Android runtime environment by using LXC (Linux Containers), recreating the directory structure of Android as a mountable loop image, whilst using the native Linux kernel to execute applications.

Installation

Make sure you have had the header files for your kernel installed (e.g. linux-headers for Linux kernel).

Install anbox-gitAUR, anbox-imageAUR (or anbox-image-gappsAUR if you want to include Google's Apps and houdini), anbox-modules-dkms-gitAUR and anbox-bridgeAUR

Start/enable the following services:

  • anbox-container-manager.service

If you don't want to reboot your computer to enable the required DKMS modules, you can load them manually:

$ sudo modprobe ashmem_linux
$ sudo modprobe binder_linux

Note

There has been cases of conflicting packages while Installing anbox-gitAUR.

So make sure you install the Android Image (anbox-image-gappsAUR or anbox-imageAUR) first and then proceed to install the other Anbox packages.

See this link if you run into a common logger.cpp error.

Network

You must execute anbox-bridge every time before starting anbox-container-manager.service in order to get network working in anbox.

The easiest solution is create a drop-in file enable-anbox-bridge.conf.

/etc/systemd/system/anbox-container-manager.service.d/enable-anbox-bridge.conf
[Service]
ExecStartPre=/usr/bin/anbox-bridge

Usage

You can run the Android applications on your desktop's launcher on Other category.

If you want to use adb to debug, install android-tools

$ adb shell

Installing apps through adb

By default, Anbox doesn't support for ARM applications. So apps must have a x86_64 architecture.

To install /path/to/app.apk

$ adb install /path/to/app.apk

To get the list of installed applications

$ adb shell pm list packages

Note that output will be similar to package:app.name, where app.name is different from the one displayed in anbox container.

To uninstall app.name

$ adb uninstall app.name

If app.name is a system app

$ adb uninstall --user 0 app.name

Installing apps through apps stores

Apps can be easily installed throught apps stores. In anbox-image-gappsAUR PlayStore is included.