As an operating system, Linux continues to be regarded as one of the most powerful platforms in the world, thanks to its stability, security and flexibility. Additionally, its cousin, Android (which runs on the Linux kernel) powers most smart phones today, with the highest number of applications of any mobile operating system.
It’s great to think that we could bring these two together at such a basic level – to run an Android application on a Linux machine without an emulator. Good news, because yes we can! In this blog post, I’ll walk you through the steps to get it running. The key steps require the use of a few tools, each of which form an important step in achieving Android app compatibility on a Linux machine.
How to run Android applications in Linux without an emulator
Way before Microsoft could bring native android support to Windows 11, Linux spoiled the party. Linux is built with a compatibility layer that enables users to run android apps on any Linux distro called WayDroid. The layer offers an enhanced performance than an optimized android emulator. Using it creates the impression like Android apps are natively running on the Linux machine. Enough of talk; let’s now put this into action.
Run apps in Linux without an emulator
Step 1: Visit WayDroid’s official website
Step 2: Screen redirection
This should redirect you to such a screen:
Step 3: Click install
Then click on install, as highlighted above. This should automatically scroll down to such a page:
You should locate a blue highlighted “docs ” link on the abovementioned page.
Step 4: Open in a new tab
Right-click on it and select the “open link in a new tab” as shown below:
Then scroll down to your PC’s distro type; in our case, we will scroll to Ubuntu/Debian and derivatives:
Step 5: Install prerequisites
Here, you must first install the Client URL, well known as (CURL). This command-line utility enables the transfer of data over several network protocols. It communicates with a web or app server by specifying a relevant URL and the data intended to be received or sent. Libcurl, a portable client-side URL transfer library, powers curl.
To do this, open up your terminal by hitting the “Ctrl+Alt+T” keyboard shortcut combinations. After that, run the following command:
sudo apt install curl ca-certificates -y
Note: When asked if you want to proceed with the software installation, type “Y/y” and then press “Enter” on your keyboard. Alternatively, you can just hit the “Enter” button on your keyboard, and the installation should be underway.
Step 6: Export the distro command
Next, issue the following command based on your Linux distro. If you are using the latest Debian, select “bullseye,” and for Ubuntu users, use jammy for the Distro. In case you get a “Permission denied” error on the way, just run the “sudo su” command and then proceed with the commands:
export DISTRO="jammy"
Step 7: Download WayDroid’s GPG key
After you are done with that, run the following-given command to help in downloading WayDroid’s GPG key on your Linux distro.
sudo curl --proto '=https' --tlsv1.2 -Sf https://repo.waydro.id/waydroid.gpg --output /usr/share/keyrings/waydroid.gpg echo "deb [signed-by=/usr/share/keyrings/waydroid.gpg] https://repo.waydro.id/ $DISTRO main" | sudo tee /etc/apt/sources.list.d/waydroid.list sudo apt update
Step 8: Upgrade the system cache repo
After that, you can run the following command in case there are packages in your system that need to be upgraded:
sudo apt upgrade
Step 9: Install WayDroid
In the end, you should be set to set up WayDroid on your Linux machine. To do this, run the command and press “Y/y”, and hit the “Enter” button whenever prompted to proceed:
sudo apt install waydroid -y
And that should install WayDroid on our Linux system. Let us now focus on how we can start our WayDroid.
How to start WayDroid
Step 10: Start WayDroid services
Now that we are almost done. We need to fire up some WayDroid services before executing Android applications on our Linux PC without an emulator. Interestingly, there are a couple of ways to get this done. As per WayDroid’s official website, you can manually start the service by issuing the following command:
sudo waydroid container start
At the tail end, run the following command, and WayDroid’s Graphical User Interface will open up on your Linux computer. You can now enjoy the Android applications on your Linux PC. By the way, you can also start WayDroid from the app drawer:
waydroid show-full-ui
And WayDroid should comfortably run.
Alternatively, you can go to WayDroid’s home page and copy the highlighted command to your terminal:
Or copy and paste the following command in your terminal as displayed here:
sudo systemctl enable --now waydroid-container
Then click the “Activities” button on your desktop and search for WayDroid as shown below:
Clicking on the WayDroid icon should pop up the following window:
On the Android type, you can either select VANILLA or GAPPS. We suggest you choose GAPPS as it allows you to install Android apps later when using WayDroid.
Then click on “Download” as shown below:
This will take some time, depending on your Internet speed. Then click on the green highlighted button”Done”:
Then go and start the application by clicking on the “Activities” menu and selecting “Waydroid” as shown below:
And you should have your Android system up and running on your Linux software:
Proceed and install Android apps on Linux and enjoy the near-native experience.
Let’s poke at this other approach to do what we have just looked at. Here we will be using Anbox.
How to run Android apps using Anbox
Anbox is software that puts the Android OS into a container, abstracts hardware access, and merges core system services into a GNU/Linux system. Each Android app will be integrated with your OS like any other native application. Anbox app is built on top of LXCv(Linux Containers) tech to segregate the system from the host; the system is from time to time updated with the current version of the Android open source project.
Now, let us see Anbox’s features.
Features of Anbox:
- It is secure – Anbox places its Android apps into a tightly sealed box without direct access to hardware on your data.
- It is convergent – Anbox scales across different form factors akin to what Android does. It functions on a laptop and a mobile phone.
- It is performant – Anbox runs Android without hardware virtualization and flawlessly bridges over hardware acceleration features.
- The project is open source – Anbox’s entire source code is freely available and licensed under the terms of GPLv3 and Apache license; it has no limitations.
- It is integrated – Tightly integrated with the host operating system to offer a rich feature set.
Emulators vs. Anbox
A significant difference between Anbox and other emulators, for instance, Genymotion, is that while others need to run on an emulator that generates its system, with its virtual hardware, kernel, and more, Anbox, on the other hand, runs an android system using the same hardware, kernel and more to host without any emulation layer, permitting better integration with the host OS.
Installation of Android apps
While play store installation is generally possible, Anbox does not ship with what is installed since Google does not permit anyone to ship their apps on an uncertified device. The vendor did not sign an agreement with them. As such, you may be asking, why should I set up software that supports other applications but can’t install them? You can solve your problem if you have an Android Debug Bridge (ADB) set up on your system, and then you just need to do: $ adb install path/to/my-app.apk, And your software should be integrated with the host system. An ADB is a tool used to debug Android-based devices.
Let us now see how we can install Anbox on our Linux system.
How to install Anbox on a Linux system
Anbox is only distributed as a .snap app. DevOps selected this option because of its straightforward nature to distribute the software to users, regular and delta updates, easy and fast packaging, and other options. There is no plan to create a Flatpak by the Anbox team, but they accept contributors who would love to port it to Flatpak. Because Anbox is still not in the stable distribution list, it does not use proper confinement for snaps. As such, it is only possible to set up on dev mode, which is not a much secure mode to install as it disables confinement of apps installed, but this should be resolved in the coming days or months.
Here are the steps to follow up to set it on your system using snaps.
Issue the following command to install it:
sudo snap install --devmode --beta anbox
Or fetch the script using the following command:
wget https://raw.githubusercontent.com/anbox/anbox-installer/master/installer.sh -O anbox-installer
And that should do it!
Just click on “Activities,” then search for “Anbox,” and click on the icon to open it
Anbox up and running:
Final thoughts
And that is how you cleanly set up and run Android apps on your Linux PC. The Linux version of the Distro you are using does not matter whether it is Debian, Ubuntu, or another distro. As mentioned earlier, the performance of Android apps is exceptional.
The above approaches have shown us that even if you don’t own an Android device, you can still run some apps or games, for instance, Gmail, Whatsapp, and many more. We hope this guide came in handy for you guys! And that is all from us. In case of any questions, please let us know in the comment section below.
1 comment
Thankyou for this article!