Execute android app on linux

How do I run Android’s .apk files on linux without the Android emulator?

I do not have a very good background of Android and the .apk files, hence these questions.

3 Answers 3

You cannot install .apk files directly onto your PC. Even though Android uses the Linux kernel, the applications runs on a totally different platform. APK files are ZIP file formatted packages based on the JAR file format, with .apk file extensions. They hold all of that program’s code (such as .dex files), resources, assets, certificates, and manifest file. They run only on the Dalvik virtual machine.

Install Android OS on your PC, if you really want to run them from a computer.

You can use the ARChon to run apk in ubuntu:

  1. Install the ARChon Runtime. http::github.com/vladikoff/chromeos-apk/blob/master/archon.md
  2. Open and enable the flag: chrome://flags/#enable-nacl,then restart Google-Chrome. (Important!)
  3. Install existing android apps in the website or convert your favourite android apps by «Online APK-CRX Converter.
  4. Drag and drop the Google-Chrome extensions into the chrome://extensions/ page in the browser and it will be installed in your browser. Enjor it!
  1. An apk file is not an executable, it’s just an archive file contaning all the resources and class files that are to be used by the application.
  2. The apk is set to be unpacked and run by the Dalvik vm.
  3. The elements that are contained inside the apk file are specifically designed and designated to be used in Android mobile phones and not a desktop PC running Linux. Though Android uses the Linux kernel, you definitely cannot run the apk file on a Linux machine, as you would an rpm or a deb file.

Thank you. Is it absolutely necessary that we need the ‘dalvik vm’ to run it, or can we replicate the operations by ‘dalvik vm’ manually, with tweaks, to make it run on linux directly?

No we cannot ! It will be like taking a human being who is designed to live and breath on earth , to Mars and tweaking Mars so as to accomodate human beings.

@Achilles Off topic, but random joke. There is two know mars missions planned, one by NASA and the other by MarsOne. These will later include teramorphing mars as there is not only ice on mars, but flowing water too. All one needs to synthesize an atmosphere is oxygen and electricity to create ozone. Back to topic, yes to «emulate» or reconstruct and optimise a vm is possible. But the time needed to do so is greater than the feasible use thereof (HrishikeshMurali)

Источник

How to run Android Apps in Linux without an Emulator

Run Android Apps on Linux

U sually, a standard android app is generated for a tablet PC or smartphone running on the Android OS. Still, this guide will explicitly show you how to set it up on your Linux machine without using an emulator.

Читайте также:  Удалить папку рекурсивно линукс

Linux, on the other hand, is an open-source operating system. An operating system is software that directly interlinks and manages a system’s hardware and resources, such as storage, CPU, and memory. The OS sits or works as a bridge between apps and hardware and connects all your physical resources that do the work and your software.

How can you run Android games or apps on a Linux machine without an emulator? Because of the creativity and inventiveness of some dedicated Dev Ops, there are currently several ways to run Android apps on Linux. This post will focus on how we can do that without an emulator. Let’s get started.

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 2: Screen redirection

This should redirect you to such a screen:

Click on install on the Waydroid page

Click on install on the Waydroid page

Step 3: Click install

Then click on install, as highlighted above. This should automatically scroll down to such a page:

it will scroll down

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:

open link in a new tab

Open the link in a new tab

Then scroll down to your PC’s distro type; in our case, we will scroll to Ubuntu/Debian and derivatives:

scroll to your preferred distro

Scroll to your preferred Distro

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

install curl

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 command

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

download gpg key

Step 8: Upgrade the system cache repo

Читайте также:  Install microsoft sql server on linux

After that, you can run the following command in case there are packages in your system that need to be upgraded:

upgrade system

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

install waydroid

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

manually start the service

Manually start the service

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:

show ui

And WayDroid should comfortably run.

Alternatively, you can go to WayDroid’s home page and copy the highlighted command to your terminal:

use this command

Or copy and paste the following command in your terminal as displayed here:

sudo systemctl enable --now waydroid-container

enable waydroid

Then click the “Activities” button on your desktop and search for WayDroid as shown below:

click on waydroid

Clicking on the WayDroid icon should pop up the following window:

select android type

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:

click on download

This will take some time, depending on your Internet speed. Then click on the green highlighted button”Done”:

click on done

Then go and start the application by clicking on the “Activities” menu and selecting “Waydroid” as shown below:

click on waydroid

And you should have your Android system up and running on your Linux software:

android system up and running

Android system up and running

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.

Читайте также:  Linux примонтировать диск навсегда

Now, let us see Anbox’s features.

    It is secure – Anbox places its Android apps into a tightly sealed box without direct access to hardware on your data.

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

install anbox

Or fetch the script using the following command:

wget https://raw.githubusercontent.com/anbox/anbox-installer/master/installer.sh -O anbox-installer ​

fetch file

Just click on “Activities,” then search for “Anbox,” and click on the icon to open it

open the anbox

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.

Источник

Оцените статью
Adblock
detector