Android is an operating system developed based on the Linux kernel for mobile devices. However, Linux and Android are two entirely different systems. Linux utilizes the GNU user environment, while Android relies heavily on Java and a different environment altogether. Additionally, Android relies on numerous specific tools and applications from Google, such as those found in the Play Store. Naturally, not all Android tools and applications are compatible with Linux. While emulating Android on PCs and laptops is relatively straightforward with software designed for Windows, Ubuntu and Linux users will need to explore how to emulate Android on Ubuntu Linux with Anbox, as detailed below.
Emulating Android on Ubuntu Linux with Anbox
Anbox was developed with the aim of bridging the gap by providing a compatibility layer between Android apps and Linux. Anbox utilizes the Linux Kernel of the host system but creates its own Android user space. Think of Anbox as similar to Wine (an application that creates compatibility layers to run Windows apps on operating systems like Linux, Mac OSX).
It's important to note that Anbox is currently in the Alpha testing phase, so it may not work perfectly right now. However, you can use Anbox to experiment and run Android features and apps on Ubuntu Linux.
How to emulate Android on Ubuntu Linux with Anbox
Installing Anbox
If you're running Ubuntu, you'll need to install Snap. Anbox is packaged and distributed as a Snap package. Use this Snap package to install Anbox.
snap install --edge --devmode anbox
Installing Anbox Modules
To ensure Anbox functions correctly, you'll need to install some kernel modules. These modules are available in the PPA, and your task is to activate these modules on the system and install them.
sudo add-apt-repository -y ppa:morphis/anbox-support
sudo apt update
sudo apt install -y anbox-modules-dkms
After installation, you'll need to restart your Ubuntu machine to ensure the modules are loaded.
Running Anbox
Launching Anbox is a bit different. The launcher won't load everything you need. What you need to do now is open a Terminal window and enter the following command:
anbox session-manager
The command will not respond. Don't worry about it; your task is to leave that window running in the background.
Next, open Anbox in the usual way you would through Unity or whichever computer you're using.
The process will take a few seconds; Anbox will open and display the apps it currently has installed for you. Essentially, only basic utilities are available, no browser or Play Store.
This is when you can explore what you've installed, everything works fine. You'll notice these are the default apps on an Android device.
Installing app packages via ADB
How to install real Android apps on Ubuntu Linux? To do this, you'll need to use ADB (Android Debug Bridge). Setting up ADB is quite easy.
Open a Terminal window and install the necessary packages with apt:
sudo apt install android-tools-adb android-tools-fastboot
After setting up Android emulation on Ubuntu Linux with Anbox, you can access websites like Mytour to download APK files of some Android app packages. The important thing to note is that you cannot extract these app packages from an Android phone because Anbox is running as an x86 computer, not ARM.
It's also important to note that not all apps will work. Currently, there's no way for apps that rely on downloading from the Play Store or Google Play Services to function on Anbox. Therefore, only apps that don't require Play Services will work on Anbox.
Use adb to install apps. While Anbox is running, open a Terminal window and enter the following command to install an app within Anbox:
adb install 'name-of.apk'
After installation, you'll see the app icon appear on Anbox. Try opening the app and check if it works.
While not the perfect solution, emulating Android on Ubuntu Linux with Anbox is a great way to experiment with Android apps on Ubuntu. Anbox can be seen as the best way to run Android apps on Linux, opening up a whole new world of apps for Linux users.
Not only does it allow Android emulation on Linux, but programmers can also develop Android programs on Linux with Android SDK. Check out how to install Android SDK on Windows, Mac, and Linux to learn how to set up Android development tools on popular operating systems.
On Linux, it's like that, but if you're using Windows, there are plenty of options to emulate Android like BlueStacks, Droid4X, or Noxplayer. Among them, BlueStacks is the leading Android emulator software, supporting the installation of most popular Android apps today such as games, chat apps, and more.