How to run Android apps on Linux 2022

Run android apps

Android apps are great. Android is one most popular mobile operating systems. Just like Mac Os and windows just changed the way we used computers in the earlier stages. iOS and Android just revolutionized the use of phones. And we end up getting smartphones where it can do a lot better than computers. Later a lot of other smartphones oses came to the market, they never got succeeded. What made them lose the battle against Android and iOS? Even Windows smartphone Os failed. It is not just because the new Operating system sucks, But due to the lack of app support. What makes a smartphone is its smart apps. If there are no apps available on smartphones then it is not smart. The android community has a lot of developers. And every business in the town has got an android app.

Read Now ==>> Sleep Command in Linux

Linux is a great operating system but due to the lack of popular apps compared to Windows and Mac OS. It drags Linux down. If we can make use of android apps on Linux then it resolves a lot of hurdles. Soon Windows will get support for android apps using the amazon apps store. Android apps are always great and installing them on Linux will be fun and productive. The android app gives us more choices, there are more than 4 million apps on the google play store. Other than google play there are many other android App Store as well. In China Google services are banned and most smartphone manufacturers have their own app stores. Android APK’s are Quite popular all around the globe.

You may also like Best Partition Managers for Linux

Do you know that android is built on the modified Linux kernel? It has nothing to do with running android apps on Linux.

Read Now ==>> How to add Kali Linux Tools on Ubuntu [Katoolin]

Now let’s make our Linux system smart by running android apps on Linux.

Anbox

Anbox is also called Android in Box. This tool helps us to run android apps in Linux. Nowadays android games are sophisticated, Running these games on PC would be great, Considering the limited battery capacity and specs of the smartphones. There a lot of tools like Bluestacks are available for macOS and Windows which helps android games run on Windows and Mac machines. They are not available to Linux systems.

But there are many other emulators available for Linux as well, But they are not popular as Bluestacks. Considering emulators for running games is not the best choice if you own a basic midrange computer. If you have a powerful PC it doesn’t matter you can throw a hell of a lot of games and applications, it works fine. It is because emulators are not a great choice and they are not efficient. They use a lot of resources. Running heavy applications can make your system crash.

There comes the Anbox. Every Linux user should try Anbox. It is a free and Open source software or tool made to run android apps on Linux. Anbox is based on the latest Android Open Source Project(ASOP). It is a window based Android environment.

Anbox is not an Android emulator. Instead of emulating, It uses a container that separates android from the host operating system. The emulator creates an entire emulated system that has its own kernel etc, whereas Anbox runs the Android system under the same kernel as the host operating system.No emulation layer like QEMU is necessary. Everything runs directly on the hardware. This approach also allows much better integration with the host operating system.

Read Now ==>> Best Screen Recorders for Linux

Features of Anbox

*from the official website

  • Open Source – The whole source code is available as Open Source and licensed under the terms of the Apache and GPLv3 license.
  • No Limits – As Anbox is running an entire Android system, conceptually any application can run.
  • SecureAnbox puts Android apps into a tightly sealed box without direct access to hardware or your data.
  • PerformantRuns Android without hardware virtualization and seamlessly bridges over hardware acceleration features.
  • IntegratedTightly integrated with the host operating system to offer a rich feature set.
  • Covergent Anbox scales across different form factors similar like Android does. It works on a laptop and a mobile phone.

Anbox puts the Android operating system into a container, abstracts hardware access, and integrates core system services into a GNU/Linux system. Every Android application will be integrated with your operating system like any other native application.

Lets Install Anbox

*from the official documentation

Currently, Anbox is distributed only as a snap as snaps. Usually, snapd comes pre-installed. In case snapd is missing in your system. Then you will have to install snapd.

To install snapd, use the terminal command below:

$ sudo apt install snapd

The minimum required operating system for Ubuntu for installing Anbox is Ubuntu 20.04 or later. The previous versions might run Anbox, officially they are no longer supported. Anbox performs better on Ubuntu when compared with other distros.

Read Now ==>> How to Fix Bash Command Not Found

Installing the Anbox snap is very simple:

$ snap install --devmode --beta anbox

If you didn’t logged into the Ubuntu Store yet, the snap command will ask you to use sudo snap … in order to install the snap:

$ sudo snap install --devmode --beta anbox

At the moment we require the use of –devmode as the Anbox snap is not yet fully confined. Work has started with the upstream snapd project to get support for full confinement.

As a side effect of using –devmode the snap will not automatically update. In order to update to a newer version you can run:

$ snap refresh --beta --devmode anbox

Information about the currently available versions of the snap is available via:

$ snap info anbox

Read Now ==>> How to install Photoshop on Linux

Uninstall Anbox

If you want to remove Anbox from your system you first have to remove the snap:

NOTE: By removing the snap you remove all data you stored within the snap from your system. There is no way to bring it back.

$ snap remove anbox

Once the snap is removed you have to remove the installed kernel modules as well:

$ sudo apt install ppa-purge
$ sudo ppa-purge ppa:morphis/anbox-support

Once done Anbox is removed from your system.

Install applications

Installation applications into the Android container provided by Anbox we currently use the sideloading functionality Android provides. For this, you need to have the Android Debug Bridge (ADB) installed on your host system. See the Android documentation for details.

If you’re running Ubuntu or Fedora you can install ADB from the package archive:

# On Ubuntu
$ sudo apt install android-tools-adb

# On Fedora
$ sudo dnf install android-tools

Once ADB is installed you’re ready to install Android applications.

Anbox does not provide any functionality to retrieve Android applications. You need to get them from a source on the internet. Once you have the APK package for the application you can install it into the Android container with the following command:

$ adb install my-app.apk

If the Anbox container is not running yet you can start it by loading the application manager application:

$ anbox.appmgr

Install Play Store

Other than side loading, There is a GitHub project that helps run Play Store in Anbox – Anbox Play Store Project

After installing Play Store, Installing Android Apps would be easier as we do on our Phones and Tablets.

Follow the Instruction to install Plat Store.

First, run the code below in the Terminal.

$ sudo apt install wget curl lzip tar unzip squashfs-tools

Download Play Store Script from GitHub.

$ wget https://raw.githubusercontent.com/geeks-r-us/anbox-playstore-installer/master/install-playstore.sh

Make the script executable.

$ chmod +x install-playstore.sh

Run the Script.

$ ./install-playstore.sh

Now Run Anbox. And Also make sure you give permission to Google Play Store from the settings. That’s it now you can install apps from Google Play Store just like you did on your phone.

Android APPS on Linux ScreenShots

These are the Screenshots of some of the default Android apps running on Linux.

Home

Anbox Home
Anbox Home

Settings Window

Settings Page on Android open on Linux
Settings Window

Files Window

The default Files app in Android
Files

Multiple Windows Open

Mutiple windows of anbox is Open
Multiple Windows Open

Anbox Documentation

Anbox Official Site

Find best Android Emulators for Linux ==> LEARN MORE

FAQ

All The FAQs are taken from the Official website. SO these are the words from the developers.

What makes Anbox different from other projects like Shashlik or Genimobile?

Projects like Shashlik or Genimobile use an emulator to run the Android environment. The emulator creates an entire emulated system that has its own kernel etc whereas Anbox runs the Android system under the same kernel as the host operating system does. No emulation layer like QEMU is necessary. Everything runs directly on the hardware. This approach also allows much better integration with the host operating system.

Is it possible to install the Google Play Store?

Yes, this is generally possible. However, Google doesn’t allow anyone to ship its applications as long as the device is not certified and the vendor didn’t sign an agreement with Google.
The Anbox project does not have any interest in shipping the Google Play store and we’re not allowed to do so. We may add an easy way for our users at a later point that allows easy distribution of Android applications suited for the Anbox runtime environment.

How can I install applications into the Anbox runtime?

There is no easy way yet for a user to install applications into the Anbox runtime, other than using the Android Debug Bridge (adb). When you have adb installed on your host system you can install applications like this:

$ adb install path/to/my-app.apk

Afterward, your application should be installed as part of the Anbox runtime and can be launched via the host system application launcher.

Is there any relationship to Google’s effort to bring Android applications to Chrome OS?

Google is implementing support in Chrome OS for Android applications in a very similar way as we do. Both approaches are quite similar as both put Android into a lightweight system container based on Linux namespaces and keep a small bridge to allow communication with the host system.
In contrast to Google’s implementation, Anbox doesn’t allow any direct access to hardware devices. For example, it bridges Open GL ES to the host. In Chrome OS the container gets access to the host kernel side of the graphic subsystem to allow fast rendering. In our case, we decided against this to keep an easy way to port Anbox to different platforms. All a host operating system needs to provide is an Open GL / Open GL ES compatible driver to provide proper integration with the graphics subsystem. Other hardware devices like WiFi or Bluetooth will be abstracted in the future via dedicated APIs between the container and the host.

My favorite Android application doesn’t work. What should I do?

As we provide a complete Android system generally all applications are supposed to work. However, there are a few exceptions:
If your application depends on particular hardware functionality like WiFi, Bluetooth, or telephony, we need additional work to bridge those over from the host system. As of right now, the only thing you can do is to ensure your application behaves correctly when these functionalities are not available.
Anbox uses the freeform mode introduced with Android 7 which allows a multi-window system. Your applications need to play well within the freeform mode to work well in Anbox. You can find more details in the Android Developer Documentation.

Anbox doesn’t start on my device. What did I do wrong?

Most likely it’s not your fault. Anbox is still in its early days and doesn’t have much test coverage across a wide range of different systems yet. If Anbox doesn’t start for you, please follow the instructions here and file a bug report so that a developer can look into the problem.

You say Anbox is convergent. Does it run on phones today?

The initial proof-of-concept was done on an Ubuntu Touch based device. Since then Anbox has evolved quite a bit, making desktop devices its main development focus. However, recent experiments show that Anbox still runs fine (with a few tweaks and lifted confinement because of older kernel versions) on mobile devices based on Ubuntu Touch.
We know that other projects like UBports or LuneOS are highly interested in running Anbox as part of their distribution. There is already a close relationship with people from these communities, but concrete plans are not yet available and the subject of each community project.

Why is Anbox only distributed as a snap?

Anbox is currently only distributed as a snap as snaps makes the life for us developers pretty easy. They allow us fast and easy packaging, easy distribution to our users, as well as regular and fast updates. Flatpak would be another alternative but we didn’t investigate this yet, nor are we planing to do so in the near future. However, we’re happy to accept contributions from the community around Anbox to provide necessary changes to distribute Anbox as a flatpak package too.
One thing which Anbox currently doesn’t do is using proper confinement for snaps. Right now it is only usable when installed in the so-called devmode of snaps which disables any confinement. This is something we will work on over the coming months with upstream to allow our snap to be fully confined.
Despite snap confinement being disabled, the Android system still stays separate through the use of Linux namespaces from the host system.

Does Anbox need a specific Android image for every device?

No. Anbox does not need a specific Android image for every device as it is specifically built in a device-independent way. Anbox will ship with a single Android image per architecture (amd64, armhf, arm64), and no device-specific modifications are required.