3 Ways to Emulate Android Apps on Linux
Whatsapp Pinterest
Advertisement

If you’re a hardcore Android fan, you’re probably aware that your favorite mobile operating system descends from Linux. We’ve covered in the past how Android is based on open source components Is Android Really Open Source? And Does It Even Matter? Is Android Really Open Source? And Does It Even Matter? Here we explore whether or not Android is really open source. After all, it is based on Linux! Read More , and that the Linux kernel is one of those. It stands to reason then that if they’re so close, it should be relatively easy to run Android apps on Linux.

As it turns out, that’s correct. Normally running apps for one operating system on another is tricky. But there are a couple of methods available for Linux users to run Android apps that make things comparatively easy. Let’s take a look.

Exising Methods for Android on Other OSes

We’ve covered a few ways in the past to run Android or its apps on other operating systems. These typically take one of two forms:

  1. The first is to use a virtual machine (VM) of some sorts, sometimes called an emulator. In a nutshell, it’s software that impersonates an entire Android system What Is a Virtual Machine? Everything You Need to Know What Is a Virtual Machine? Everything You Need to Know Virtual machines allow you to run other operating systems on your current computer. Here's what you should know about them. Read More . An example of this is the emulator included in Android Studio, which we used extensively when creating a simple Android app How to Create an Android App: Everything You Need to Know How to Create an Android App: Everything You Need to Know If you want to get starting making your own Android app, this guide includes everything you need. Read More . You could also use a general-purpose VM tool like VirtualBox How to Use VirtualBox: User's Guide How to Use VirtualBox: User's Guide With VirtualBox you can easily install and test multiple operating systems. We'll show you how to set up Windows 10 and Ubuntu Linux as a virtual machine. Read More , and run one of the flavors of Android designed for desktop use 3 Ways You Can Use Android as a Desktop Operating System 3 Ways You Can Use Android as a Desktop Operating System It's actually pretty easy to use Android as your desktop operating system once you know how. Read More . Finally, BlueStacks How to Emulate Android and Run Android Apps on Your PC How to Emulate Android and Run Android Apps on Your PC It's actually pretty easy to get Android apps running on your desktop or laptop! Here, we step you through the best methods. Read More is a more optimized example of this method for Windows.
  2. The second method is to use compatibility software. While their precise methods vary, they are designed to translate the Android software’s input and output to something the host machine can understand. One approach uses the Chrome browser with an add-on called ARChon How To Run Android Apps in Chrome on Mac / Linux / Windows How To Run Android Apps in Chrome on Mac / Linux / Windows It's now possible to run Android apps in the Chrome browser -- it just takes a little bit of work. Read More to achieve this effect.

In the below sections we’ll explore the following Linux-native solutions, which use the above options to varying degrees:

  • Anbox, which uses Ubuntu’s Snap package format. It operates more like a compatibility layer, and launches applications from a “control panel” of sorts.
  • Shashlik, which uses an optimized VM based on QEMU. It creates entries for Android apps in your regular system launcher.
  • Genymotion, which uses an optimized VM based on VirtualBox. It runs a full virtual device interface.

We’ll explore each of these options below in more detail.

1. Anbox

Anbox, as the name implies, bills itself as “Android in a box.” It’s a Linux application that provides a complete Android software stack in a container, similar to the way Docker operates How to Safely Test Desktop Applications in a Secure Container With Docker How to Safely Test Desktop Applications in a Secure Container With Docker Docker is a popular platform for developing and testing server-based applications. But did you know you can also use it to safely and secure run new programs on your desktop? Read More . Distributed as a Snap package How Ubuntu 16.04's New Package Format Makes Installing Software A Snap How Ubuntu 16.04's New Package Format Makes Installing Software A Snap In version 16.04, Ubuntu is hoping to strike a balance between having stability and staying up-to-date, with a new way to install apps. Let's find out how "snaps" work. Read More , your distribution will need to support that format Ubuntu Snaps vs Red Hat Flatpaks, What's the Difference? Ubuntu Snaps vs Red Hat Flatpaks, What's the Difference? Linux distros distribute apps in many formats. For years, the two most popular have been .debs and .rpms, but this may be starting to change with Ubuntu's Snap packages and Red Hat's Flatpak. Read More — fortunately, most major ones do.

You can search for it in your software center, or use prompt command like the following one for Ubuntu:

sudo apt install snapd

Now that the Snap system is installed, use the command from the Anbox website to download and install it:

snap install --classic anbox-installer && anbox-installer

The terminal-based installer script will fetch everything for you. It will start by performing some admin functions like adding a new software repository and installing prerequisites. It’ll then download the Anbox Snap package (shown in the below image) and install it.

emulate linux anbox install snap6

Once it’s installed, you can confirm it’s running with the following command:

emulate linux anbox running

Once Anbox is installed, you can launch it from your main menu. It showed up in the “Lost and Found” category for me, but it should appear with a text search. After a few moments, the “Anbox Application Manager” should pop up on the screen.

emulate linux anbox launcher

The project’s website states upfront it’s still in heavy development. You’ll feel this when it’s time to install your first app. There’s no nice graphical, drag-and-drop way to do so — you’ll need to use the Android Debug Bridge (ADB) How to Use ADB and Fastboot on Android (and Why You Should) How to Use ADB and Fastboot on Android (and Why You Should) Learning to master ADB and Fastboot can make your Android experience a whole lot better. Read More . This tool is part of Android Studio, so if it’s already installed, you’re all set. If not, you can install Android Studio (as it provides its own emulator, another option), or see if they’re available from your package manager.

On Ubuntu, the following will get you what you need:

sudo apt install android-tools-adb

Now you can install an app for which you have an APK file handy. The following command will install Orgzly, a note-taking and to-do app:

adb install com.orgzly_83.apk

Finally, you’ll see the app’s icon pop up in the Anbox window. Clicking on it will open the app just like you’d expect (the below image shows the Orgzly app we installed above):

emulate linux anbox orgzly

The Esc key acts like the back button, allowing you to close the apps.

2. Shashlik

Shashlik is another option, and is similar to Anbox. While the latter uses the container technology of Snap packages, Shashlik actually includes a lightweight virtual machine based on QEMU 3 Ways to Run a Virtual Machine on Linux 3 Ways to Run a Virtual Machine on Linux If you want to run a second operating system on your Linux machine without rebooting to switch between them, a virtual machine is your only answer. Read More .

After downloading the hefty DEB package, you can install it in an Ubuntu system with the following command:

dpkg -i shashlik_0.9.3.deb

The installation of apps in Shashlik is also a work in progress. But the installation command is a little more straightfoward:

/opt/shashlik/bin/shashlik-install name_of_app_file.apk

Once this completes, you’ll get a nice little popup saying it was successful.

emulate linux shashlik installed

You’ll also get an entry in the launcher menu (under the “Android Apps” category), and when you click it, the app will launch. The start-up time for Shashlik is noticably longer than Anbox, as it is actually starting up a proper VM:

3 Ways to Emulate Android Apps on Linux emulate linux shashlik launcher e1514612777811

Finally, your app will open in what is probably a very small window. There are some QEMU settings in */opt/shashlik/android/hardware-qemu.ini that you can tweak to get a larger screen.

emulate linux shashlik running

Overall, the experience seems a little easier getting Shashlik installed and set up with some apps, if you’re okay with the slower start-up.

3. Genymotion

Genymotion is slightly different from the above two options.

Firstly, it’s a commercial product, so if you want to use it long-term you’ll need to pony up some cash. This also means you’ll need an account with Genymotion in order to even download the trial. Lastly, it’s positioned as a developer tool, meaning it’s not really meant as a convenient way to launch apps so much as a fully decked-out system to test with. If none of these things turn you off, you can start by filling out a simple form and registering for an account:

emulate linux genymotion signup

After logging back into your account, click the “Trial” button at the top-right of the page. It will take you to a download page where you can pick a version of Genymotion for your system. While this is downloading, you should also make sure you have VirtualBox installed, as Genymotion uses it.

3 Ways to Emulate Android Apps on Linux emulate linux genymotion download

Once complete, make sure you give the BIN file executable privileges One Of The Most Important Tools In Linux - Understanding Chmod One Of The Most Important Tools In Linux - Understanding Chmod There are plenty of features that make Linux special, but one of them that makes it so secure is its permissions system. You can have fine-grain control over all the files in your system and... Read More , then run it as root (as shown in the command in the below image).

The simple setup will finish quickly, informing you of the available “/opt/genymobile/genymotion/genymotion” command. Running this will start the application:

emulate linux genymotion installer1

The trial version will come up asking for authentication or a license. Opt to Sign In and provide your account credentials. After accepting the EULA, you’ll be asked to create a virtual device:

emulate linux genymotion virt device

The app provides a selection of old and new devices. Selecting one and clicking Next twice will kick off the process, downloading and setting up the new device.

emulate linux genymotion virt device download

Once installed, you need only select the new device from the list in the app’s main window and click the Start button:

emulate linux genymotion virt device launched

Once it’s running, you’ll see what appears to be a full-fledged Android device in a window.

But at first it only contains a minimal set of apps. Fortunately, with Genymotion you can use a graphical method (drag and drop) to install new ones. Dropping an APK file on the window will automatically transfer it to the virtual device, install it, and run it. In the below image we can see (again) Orgzly, this time in higher resolution:

emulate linux genymotion running

So Which One Is Best?

The answer to this is easy: the one that runs the app(s) you need. And as is often the case, don’t think you need to select just one. If you have an app the works like a charm in Anbox, another one that hums in Shashlik, and another that requires the full horsepower of Genymotion, use them all! Feel free to throw the Android Studio emulator in there too, just for good measure!

Do you have any Android apps that you absolutely must have on your desktop? Have you used any of the above solutions? How do they compare to the likes of BlueStacks? Sound off with your thoughts and tips in the comments below!

Explore more about: Android, Emulation, Linux.

Enjoyed this article? Stay informed by joining our newsletter!

Enter your Email

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. Allen
    September 3, 2018 at 7:47 am

    Hi, I found your Linux desktop looks very beautiful and I want to have a try. What kind of Linux distribution are you using and what theme it is?