How to run Android apps and games on Linux. Running Android Linux applications using Sahshlik Android applications on Ubuntu

Hello, dear readers of the best mobile portal site! In this article, I will tell you about running full-fledged operating systems on Android. Today, we will talk about two operating systems - Windows XP and Linux. So let's get down to business.

LINUX

Let's start with an easier instruction - running Linux on Android. To begin with, I will warn you that for this method needed ROOT rights. Also, if you are using a smartphone on Android based 5.0 Lollipop, Android 6.0 Marshmallow or later, then you need a custom kernel. This article uses a Nexus 5 with the "ElementalX" kernel installed. So let's get started.

Instructions:
1. First, you need to download and install the BusyBox program, which provides most standard Unix tools.

2. Next, download and install the Linux Deploy program, this is the main component and without it we won’t be able to do anything, since it downloads the distribution from the official mirror, creates a disk image on microSD card, mounts it and installs the operating system distribution.
3. Having opened the Linux Deploy application, go to the configuration panel. Here, choose which distribution you want to use. This article will use the default Debian distribution in the LXDE environment.

4. Having selected the distribution, click on the install button. Installation takes about 30 minutes.
5. Once installation is complete, the application will launch Linux environment and will set up the working environment itself, which includes the base system, SSH server, VNC server and the graphical environment that we selected earlier. Also, you can configure it through the program SSH server and VNC.
6. You can connect via SSH or VNC, I use a VNC server, but you can use whichever one you want.
7. If you connected via SSH server, enter port "22" and default password is "changeme".
8. If you, like me, want to connect via a VNC server, download the VNC program, run it and enter the address “localhost:5900” in the field, the default password is the same as for the SSH server - “changeme”.

9. Enjoy your Linux distribution running!

Windows XP

Now, about something more complicated - Windows startup XP on Android. Can you tell me how? The answer is simple - Bochs. It is with this application that we will emulate Windows XP. Bochs is a program that emulates x86-based operating systems, it was created to emulate operating systems such as Windows DOS, Windows 3.1, Windows 95, Windows 98. But today we will try a more difficult task. It's important to note that Windows work XP will be very, very slow and there will be no internet connection, so if you have patience and don't care about the problems that may arise, then go ahead! So, let's begin.

What do you need:
1. ISO file Windows XP
2. Qemu Manager for PC
3.
4. Bochs SDL
5. Blank Disk Image

Instructions:
1. Open Qemu Manager for PC and create a new virtual machine. Call it whatever you want, in this case its name will be “XP”.

2. Enter how much random access memory you want to allocate for virtual machine, this step is only for PC, it will not affect Android device in any way. Select the "do not use" option virtual disk" Click "next".

3. The next step is to go to the drivers tab and select “ HDD 0". Next, select the path to the previously downloaded “Blank Disk Image”.

5. Finally, after completing all the steps, select the green button in the top left corner to start the virtual machine. From now on, simply install Windows XP on the virtual machine as on a simple PC.

6. Once the installation is complete, unzip the Bochs SDL .zip file. Move "Blank Disk Image" to the SDL folder. Rename the "Blank Disk Image" file to "c".

8. Download and install the Bochs app on Android. Next, open it. The application itself must detect the presence of Windows XP and launch it. Remember, this is very, very slow!

To boot to the operating room desktop Windows systems XP, you need to wait at least 10 minutes.

9. Rejoice running Windows XP!

That's all. Thank you all for your attention!

Starting a review best emulators Android for Linux, we decided - perhaps unsurprisingly - to hunt for emulators. However, we quickly realized that there were many ways to achieve our goal of running Android applications on Linux. That's why we also included Anbox, even though this program is in pre-alpha stage Anbox follows the same philosophy as WINE: both try to implement as much of Android's system calls as possible. This approach is more effective than emulation because your applications will run natively. The hardware requirements for the emulator are painfully clear when working on a computer with little memory.

How we tested emulators

We started by installing different solutions to see what problems you might encounter before you were ready to run applications. For example, Anbox, according to information on its website, is at the pre-alpha stage. Next, we tried to install applications directly using Google Play and third party loading technologies. One method is to use adb on the running instance. We also measured the performance of each emulator and the amount of memory required.

Another aspect of testing is why each package is designed; for example, to play Android games on your PC. By the way, our test car is Intel Core i3 CPU with 4 GB of memory, which is quite limiting for running emulators. And if you have a good reason to run Android apps on your Linux computer, buy and install more RAM.

Android emulators for Linux

Some of the packages come as ISO images, which you copy to a USB flash drive and run from there. You can also install Android-x86 as a standalone OS using a Grub file. This approach means that in front of you is no longer an emulator, but rather an entire distribution kit. Before choosing a specific package, ask yourself what your goal is. Some packages are designed for gamers, while others are designed to help test new programs. For development and testing, you will not need the same package that is intended for using Android entertainment applications.

Android Virtual Device

Android Virtual Device is the most mature development and testing package available. If you start with Android Studio, it's perfectly integrated and a natural fit for testing. However, the latest release contains a bug and you will have to run the AVD from command line using the -use-system-libs option.

Android emulator for Linux Android Virtual Device

When working in a virtual device, you have all the necessary functions, including GPS, camera emulation and rotation simulation. AVD works well and by adding Google Play you can use it for regular apps. However, games may be slower since you are using a virtual device. Only the most modern CPUs allow you to run multiple virtual CPUy. Other, less graphics- and CPU-intensive applications will work fine; but in general AVD is best suited for testing new applications you've created.

Android-x86

Android-x86 is not quite typical, because it is designed as a distribution. To install it, you can use the rpm file and run your laptop as an Android device. After rebooting, you can immediately go to your regular profile user and install applications from Google Play. It will be a very responsive device since the underlying system is smaller. And, of course, you can set up your own instead Linux installation. When emulating, there will also be problems with resources, like other Comparison emulators, but less severe.


Android emulator for Linux Android-x86

This package is the best for using applications, but we recommend it for testing unless you specifically want to develop for Android_x86. There is no camera simulation or device switching from profile mode to landscape mode, so testing these functions in this emulator will not work.

Anbox

We couldn’t help but include Anbox in our Comparison, although we understood that this could backfire on us. Which was justified. Getting Anbox to work has had varying degrees of success, since, according to the developers, it is at the pre-alpha stage. When it works, it's a great tool to use with single applications because it's system requirements little more than the requirements of a typical application.


Android emulator for Linux Anbox

The installation process uses Snap, making installation and removal simple. Remember that on currently you need to install anbox-installer Snap, which in turn will install Anbox. The installer script runs apt, which installs the libraries and kernel modules required for it to work. Only the most adventurous users can take the risk before the first beta release is released. Please note that this package is more of a container than an emulator.

Genymotion

Genymotion is at least as good as AVD when it comes to simulating hardware features, and it consumes the same amount of memory and resources on your computer. If you install Gapps right away, you can install apps for everything through Google Play. Considering its resource consumption, you will need a lot of memory to run large applications, but the main purpose of this emulator is to test new programs without causing any problems.


Android emulator for Linux Genymotion

The company that creates it has prepared many images for emulation different phones and clearly counts on serious developers of its paid version of the emulator. You'll get along great and free version, even if you need to simulate different positions of the phone. If you just want to run some application on your desktop, then this package is probably overqualified for the task.

Shashlik

Shashlik is also in the very early stages of development, which becomes obvious when you try to launch it. The installer works by default, and even the application installation script works flawlessly. When you try to launch applications, things get more complicated. Many settings are built into the launch script, and finding parameters to launch it is a real challenge. Support also appears to have reached a dead end. The most recent work on the development tree on github was observed two years ago.


Android emulator for Linux Shashlik

Despite this, the project looks interesting, and we hope that someone will take it up again. The quirks of adding apps are gone, and when you install an Android app, the launcher icon is immediately available. You end up running required applications, as if they were built-in, despite the fact that they are emulated in QEmu running in the background.

Installing an Android emulator on Linux

When installing programs on popular distributions, we use familiar package managers such as apt, dnf, etc. However, sometimes installing programs is done by simply downloading a binary package, like Anbox. It comes in Snap format, a standard developed and still supported by Canonical. Anbox is a program. is in the pre-alpha stage, and even if you succeed in the installation, getting it to work is a completely different matter.

The standard way to emulate Android devices is to use Android package Virtual Device for Android Studio. You can run it without Studio if you just want to try out the application. Considering the resources consumed by Android Studio, this is a useful option. However, it is best to install the emulator as part of Studio.

Android-x86 is created as a new distribution when you install the rpm file. It adds an entry to the Grub menu so the next time you boot, you can simply select it and start your computer as an Android device. To run it in parallel with your regular tasks, you need VirtualBox or QEmu. In fact, many emulators in our review use VirtualBox for virtualization.

Genymotion consumes the most resources at startup. However, if you have VirtualBox, installing it is easy. To install it, download and run the binary installer. When you first launch the application, there are no virtual devices yet, and you will need to select them from an extensive list; downloading and configuration occur automatically.

Shashlik follows the same philosophy as Anbox. but accesses the QEmu emulator. Despite this, it is fast and also uses a simple installation script to side-load arc files. To install Shashlik, you can use the Debian package with the dpkg -i command. After installation, you may need to change some settings - for example, enable the GPU. To do this, open and edit the Python script shashlik-run.

Performance of Android emulators

To test these packages, we took a 4 GB computer, which turned out to be far from ideal. The reason is that typically each virtual machine needs about 1GB of memory, and a full-featured Gnome desktop takes up 1.5GB with a few notifications and cloud storage synchronization. When you launch Firefox, you're getting close to filling up quickly and should save memory.

Anbox implements challenges, making it ideal to run alongside your regular applications, but, unfortunately, is at an early stage of development. We do not recommend using it on an ongoing basis, and this is hardly possible.

If you just need to run your PC as an Android device, use Android_x86, it works extremely well.

Other packages run through virtualization, specifically from VirtualBox, which makes them difficult to run alongside other programs. In other words, if you want to develop and test Android applications, get a 16 GB computer and you can run the emulator in parallel with your IDE.

The most capable and integrated choice is the tandem of Android Studio and AVD when developing and testing on the same computer. To simulate many features such as camera, GPS and phone tilt, it is convenient to use Genymotion, it is a great tool. Plus, it shows the screen exactly as it appears on the actual physical device.

Ease of use with the emulator

There are many reasons to use virtualization. Hobbyists may need an application that does not work on their OS, or want to test programs they have developed.

Other use cases are on commercial servers where virtualization comes in handy for security purposes and load balancing issues. In this section, we will demonstrate for what purposes specific packages will be most convenient.

The packages also provide a number of features that may influence your decision. However, the richer this functionality, the more the load on your system increases. We see that two commercial solutions have the largest number of functions, but are also the most demanding on system resources.

In our review, the most effective solution for launching applications is Anbox. He does without imitation equipment and is ahead of everyone else, but is not yet ripe for production activities.

Managing applications in the emulator

Once your emulator starts up, it's time to install your favorite apps. On normal Android device you will have Google Play or even FDroid. In emulators, you usually need to install Gapps to access the Play Store. There are other ways to add apps to your virtual phone. Can be used on a virtual device; it runs on emulators and container solutions like Anbox. Android_x86 has the Play Store installed by default, which allows for a very quick start.

With AVD you can run installed applications or an application you are developing in Android Studio. Installing applications from using Google Play is included in some images, but not all. Another way to install from an apk is to drop the file into the emulator window. This will install the app instantly - or at least try to. Genymotion also supports drag-and-drop. In any case, the apk must be for x86. or the installation will fail. Also, you will need Adb before you start.

You can also try working with Shashlik. Shashlik functions as a container, much like Anbox. but has a built-in installation function. Once you install the application. it will appear as an application in your desktop list. On our Gnome desktop instance, typing shashlik' displays all installed applications. You will then be able to launch your favorite applications directly like the rest of your installed ones.

Emulator documentation and support

Documentation is usually the weak link in amateur projects, which is unfortunate if the proposed designs are so elegant. Our Comparison had the same results, Android Virtual Device has all the documentation and support you could ask for, and when you use it with Android Studio, it's even better. Genymotion has an excellent FAQ with basic solutions to help you get started, and if you work professionally there is a paid version.

The documentation is top notch and clearly aimed at active developers. She is the best. Android~x86 is very mature and has fantastic documentation, with an excellent FAQ. Community help is provided through Google Groups. They are active and can help you if you have problems. Anbox is so new that there is even documentation on how to install it and get started. But while the FAQ is fairly clear, other documentation is sparse. We can forgive such a shortage, because the program is at the pre-alpha stage, and most of the functions have not yet been written, let alone their documentation.

We hope that work on Anbox continues because it is... effective method port Android apps to Linux. If you would like to contribute to the development, please take a look at the help page. Despite the fact that the download file for Anbox itself is only 1.5 GB. the only thing you need to take into account is the tree Android development. Shashlik uses the Ark installation, but the program is not nearly as well documented.

Emulator development activity

Using the program, we want to know how problems can be solved. This requires support or ongoing development. In the case of the emulators from our Comparison, as expected, the most active ones are Genymotion and Google apps. However, Genymotion has a solid investment in the cloud and other professional solutions. so hobbyists may find themselves put off by its corporate zeal. Naturally, Android Virtual Device is also strong in this regard.

With the remaining projects, everything is less clear, and we had to check their activity on their web pages and GitHub.

Android_x86 released new version in June 2017 and may have released another one before our review was published. This project is very active - it is literally unstoppable. This is an exciting time for its developers and users. If you want to help the development, keep in mind that the source tree is more than 10 GB. so save some disk space.

Anbox works daily and updates the source code weekly - this project is really taking off! It will be a valuable addition to the list of Linux programs. This is especially convenient if you are already using the application on your phone and want to continue to use the familiar interface. Many Android apps consume very little memory and are quite efficient. If you want to help, the instructions are quite simple for those who already know how to handle .

Shashlik has had no visible activity on its webpage or GitHub for two years now. Unfortunately, we may have to admit the failure of this project. The code is still available on GitHub, in case there is any brave soul with free time and the desire to get down to development.

Source availability

All packages in our review come from open source, so find source should be relatively easy.

But it is not always the case. Everything from Google has two branches: one for internal development and one for the public. Google does this to keep new features secret until release. Regular developers and those with special talents can use the public thread to submit patches. In this section we will look at what programming languages ​​are used and whether the tree is available for download. We will also find out the size of the source tree. Remember that the tree for a single package is usually on top of the kernel source code and development tools.

The entire Android tree is available at www.source.android.com. The package that includes the dev toolset is around 10GB, but it would be smart to allocate 20GB to it.

This package is standard, but it's also a hefty package, so make sure your computer has enough resources to use it.

Android_x86 is 4.5 MB in size. on top of the kernel tree. The project mostly uses C++ and scripts, mostly in the shell. This project is most interesting when you want to run Android on other devices, not when you want to test apps for mobile devices.

The Anbox download source is small, only 1.5 MB. and Anbox is mostly programmed in C++. If you want to learn container technology, you can take on some of the tasks in this project since that is what is being used there. If you want to take a serious look at the most important technology currently in use, this is where you dig in. Anbox is hosted on GitHub.

Genymotion implements its own code in C++, and most of its scripts use Perl. The scripts use a modified kernel for virtual machines. Their source code for downloading weighs 135 MB.

The source code for Shashlik no longer appears to be maintained, but it is available on GitHub. There is even an offshoot that has been updated throughout 2017, so hope remains alive. Someone made a Docker file so that you can run it with Docker containers. 6 MB downloaded. and programming was carried out in C++ and C. The scripts were mainly written in Python.

conclusions

Android has become the leading OS in smartphones. More and more online activity is mobile in origin. Any new web design should be ready for mobile use. And any attempt at action on the Web or in the field of programming must take this into account. In order for your web page or program to reach as many people as possible, you need to move it to mobile if it makes sense for your application. To achieve this, you must either write it directly for mobile, or find a solution that combines both approaches. In our review we considered the possibility of making mobile programs available on any Linux device.

If you want to test the program for different devices 8 multiple scenarios, two commercial solutions. Android Virtual Device and Genymotion are far superior to the rest. For developers they are quite universal and useful.

For those who just want to run an app or game on their desktop, other apps are better suited. Anbox and Shashlik are designed for just this purpose. Unfortunately they are not mature enough to use AVD. Android Studio is a package best suited for developing applications specifically for Android. They work in tandem for development and testing. Genymotion is another very decent framework to support your testing.

Other packages are more interesting when you are using existing applications. Additionally, you can use them as a starting point if you want to learn more about C and C++, and perhaps. move on to kernel programming.

operating system Android is somewhat different Linux a system that runs cross-platform applications written in the language Java, in a virtual machine environment ART (Android Runtime) in new versions and Dalvik in the old ones.

We will not delve into the intricacies of the architecture and interaction of system components, the main thing to know is Android based on Linux, but has some differences.

Today phones android They have firmly entered our lives and many people actively use them. Along with the devices themselves, mobile applications. Sometimes they can completely replace simple functions PC- viewing mail, playing music, movies, reading news.

Surely someone wondered whether it is possible to use mobile applications android on PC? Answer - Can, but with some restrictions.

The article discusses the question of how to do this. Whether this makes sense, everyone decides for themselves.
The description of the process is not a call to immediately do this in your operating system and is given within the framework of the thesis " just for fun"that is, for the sake of interest.

We will need:

operating system LINUX(distribution version is not important)

Browser Google Chrome 64 bit (Chromium and chromium browsers like Opera, Vivaldi, Yandex etc unsuitable),

32 bit assemblies are no longer produced.
- extension For Google Chrome ARChon.

IN linux unable to run file directly apk applications android, even if the extension is installed ARChon.

To run it, you need a special way to convert And install Also as an extension ARChon.
There are several ways to convert applications. You can choose the one that works best for your conditions.

1 . By using chromeos-apk(the most reliable).
Install Node.JS
Use your package manager.
Warning! IN Ubuntu repository Node.JS does not work because the developer stopped supporting it.
Distributions based on Arch perfectly placed from AUR.
Next we put chromeos-apk also from AUR.

We do it ourselves transformation APK file team in terminal:

Chromeos-apk /path/to/.apk

Who not Arch distribution, then we use other methods described below.

3 . Using the extension Twerk For Google Chrome from Google Web Store

4 . program apk2archon in python. github link

You can read more on the 4pda website, which describes in detail how to change size application, what parameters to set at startup.

Installed applications can be found in application menu. In chapter " Chrome apps".

By editing you can change launch icon.

Sami extension applications will be stored in folders like com.twitter.android.android, you can copy the desired icon to this folder icon.png(to launch the application and display in the menu).

operating system Android is somewhat different Linux a system that runs cross-platform applications written in the language Java, in a virtual machine environment ART (Android Runtime) in new versions and Dalvik in the old ones.

We will not delve into the intricacies of the architecture and interaction of system components, the main thing to know is Android based on Linux, but has some differences.

Today phones android They have firmly entered our lives and many people actively use them. Along with the devices themselves, mobile applications are also becoming popular. Sometimes they can completely replace simple functions PC- viewing mail, playing music, movies, reading news.

Surely someone wondered whether it is possible to use mobile applications android on PC? Answer - Can, but with some restrictions.

The article discusses the question of how to do this. Whether this makes sense, everyone decides for themselves.
The description of the process is not a call to immediately do this in your operating system and is provided within the framework of the thesis " just for fun"that is, for the sake of interest.

We will need:

operating system LINUX(distribution version is not important)

Browser Google Chrome 64 bit (Chromium and chromium browsers like Opera, Vivaldi, Yandex etc unsuitable),

32 bit assemblies are no longer produced.
- extension For Google Chrome ARChon.

IN linux unable to run file directly apk applications android, even if the extension is installed ARChon.

To run it, you need a special way to convert And install Also as an extension ARChon.
There are several ways to convert applications. You can choose the one that works best for your conditions.

1 . By using chromeos-apk(the most reliable).
Install Node.JS
Use your package manager.
Warning! IN Ubuntu repository Node.JS does not work because the developer stopped supporting it.
Distributions based on Arch perfectly placed from AUR.
Next we put chromeos-apk also from AUR.

We do it ourselves transformation APK file team in terminal:

Chromeos-apk /path/to/.apk

Who not Arch distribution, then we use other methods described below.

3 . Using the extension Twerk For Google Chrome from Google Web Store

4 . program apk2archon in python. github link

You can read more on the 4pda website, which describes in detail how to change size application, what parameters to set at startup.

Installed applications can be found in application menu. In chapter " Chrome apps".

By editing you can change launch icon.

The extension applications themselves will be stored in folders like com.twitter.android.android, you can copy the desired icon to this folder icon.png(to launch the application and display in the menu).




Top