Linux emulator android studio

How to Setup Android Emulator Without Installing Android Studio in Linux

This article will explain how to install the official Android emulator as a standalone application in Linux. The official Android emulator comes with the “Android Studio” application development suite. However, if you are not interested in developing Android apps and just want a working emulator without installing Android Studio, this article should help you. All the steps mentioned in the article are tested on Ubuntu 20.04 LTS version.

Install Command Line Tools

Download the latest version of “Android Command Line Tools” from here (scroll down to the command line section).

Extract the downloaded archive and make a new folder named “tools” inside “cmdline-tools” directory. Copy and paste all files from “cmdline-tools” folder to “tools” folder. Your final directory layout should look like this:

Install Required Packages

Go to the “tools/bin” folder, launch a new terminal window and run the following command to update repository details:

Next, run the following command to list available and installed packages:

Install some packages required for the Android emulator to work:

Find Correct System Image to Use

Next you need to make a note of the system image you want to load in the Android emulator. To get a list of downloadable system images, run the command below:

You should get some output similar to this:

You will see some numbers like “27”, “28” etc. in the name of system images. These numbers denote Android API levels. Find the Android version corresponding to the API levels from here and make a note of the appropriate system image you want to use in the emulator and the API level number.

Download System Image and Corresponding Packages

Next, download the following packages using the same API level number you finalized in the step above:

$ . / sdkmanager “platforms;android- 30 ” “system-images;android- 30 ;google_apis_playstore;x86_64” “build-tools;30.0.2”

For instance, if you decided to use “system-images;android-29;default;x86_64” as the system image, the command would change to:

$ . / sdkmanager “platforms;android- 29 ” “system-images;android- 29 ;default;x86_64” “build-tools;29.0.3”

You can always use the “list” switch to find correct command and version numbers:

Create a New AVD

AVD or “Android Virtual Device” is a set of configuration parameters that defines values for a virtual device that will emulate a real Android hardware device.

Читайте также:  Подключить второй диск линукс

To create a new AVD, you need to use the system image you downloaded in the step above. Run the following command to create a new AVD:

$ . / avdmanager create avd -n “my_avd_30” -k “system-images;android- 30 ;google_apis_playstore;x86_64”

Replace “my_avd_30” with any name of your choice. You may be prompted to alter some configuration parameters. Follow on-screen instructions and change the values as per your requirements.

Confirm that the AVD has been successfully created using the command below:

You should get some output similar to this:

Available Android Virtual Devices:
Name: my_avd_30
Path: /home/nit/.android/avd/my_avd_30.avd
Target: Google Play (Google Inc.)
Based on: Android 11.0 (R) Tag/ABI: google_apis_playstore/x86_64
Sdcard: 512 MB

Note the path of AVD in the output above. At the same path, you can find a “config.ini” file that can be used to change configuration parameters of the AVD.

Run Emulator

Go to “emulator” folder (up a few directories) and use the following command to launch the emulator:

Replace “my_avd_30” with the name of your own AVD you created in the step above. Your Android emulator should be now up and running:

You can create as many as AVDs as you want and each AVD / System Image will be treated separately.

Conclusion

Android emulator provides an excellent way to emulate real life Android devices on your desktop PC. You can use the emulator to test some apps that are yet in development or you can use the emulator to regularly run Android compatible apps and games on a Linux PC. The performance of the emulator will depend on your system’s horsepower, virtualization technologies available on your PC and your system’s compatibility with the KVM kernel module.

About the author

Nitesh Kumar

I am a freelancer software developer and content writer who loves Linux, open source software and the free software community.

Источник

Best Way to Run Android Apps and Games on Linux

It’s been some time since Android smartphones came into our lives. The Google Play Store is now home to around 3 million Android apps and games, many of which are so useful or entertaining that many Linux users would like to run them on their favorite operating system.

Thanks to the hard work of some talented developers, there are now multiple ways to run Android apps and games on Linux, and we describe seven of them in this article.

Why Running Android Apps Don’t Run Natively on Linux?

Considering that Android and Linux share the same kernel, one might assume that it would be easy to run Android apps natively on Linux, but it isn’t. That’s because the kernel is just the core of an operating system, and it takes a lot more software than just the kernel to run the applications you interact with on a daily basis.

Читайте также:  Archlinux vs linux mint

Furthermore, Android APK files are not straightforward executables (like .exe files on Windows). They are essentially installer packages whose purpose is to extract files to certain specific locations. When executed, the extracted files call certain functions of the Android operating system to access the file system, hardware components, and so on.

Popular Linux distributions make no effort to be compatible with Android apps, so Linux users have to simulate Android devices on their computers using Android emulators or use an operating system that’s compatible with Android apps.

1. Anbox

Anbox is conceptually similar to Wine (a free and open-source compatibility layer that makes it possible to run Windows applications on Linux) because it abstracts hardware access and integrates Android applications with the Linux operating system.

The entire project is open source and licensed under the terms of the Apache and GPLv3 license. The goal of its developers is to make it so that every Android app and game can run on Linux. Because Anbox runs without hardware virtualization, it offers decent performance and tight integration with the host operating system.

Because Anbox is distributed exclusively as a snap (its developers claim that snaps make their lives much easier and allow them to frequently release updates without the need to customize them for multiple distributions), you can install it only on supported distributions unless you install Snap manually, which takes just a few simple commands, all of which are described in detail on Snap’s website.

With Anbox installed, you can add APKs using the Android Debug Bridge (adb). Afterward, you can launch your applications via the host system application launcher and manage them just like all other applications running on your system.

2. Arc Welder

If you’re a Google Chrome user, you can run Android apps on Linux using ARC Welder, also known as App Runtime for Chrome. This Chrome extension is actually intended to let Android developers test and publish their Android Apps to Chrome OS on other platforms, but that doesn’t mean you can’t use it for your personal purposes.

Because Arc Welder is a tool for developers, it doesn’t provide access to apps published in the Google Play Store. In order to run an Android app, you first need to find and download its APK file and then open the file using Arc Welder. Fortunately, there are many websites that let you easily download APK files, including APKMirror, APKPure, or APK Store.

Unfortunately, Arc Welder was last updated in June 2018, so bugs are to be expected. Still, you would be hard-pressed to find and easier way to run Android apps on Linux.

Читайте также:  Linux alias with parameters

3. Genymotion

Because this is the year 2020, we can’t recommend the once-popular Android emulation solution called Shashlik anymore. The last version of Shashlik was released in 2016, and its developers have been quiet ever since. However, we can recommend something even better: Genymotion.

This cloud-based Android emulator is a boon to all Android developers who would like to streamline app testing and enjoy virtually unlimited scalability thanks to the computing power of Amazon Web Services, Microsoft Azure, Google Cloud Platform, and Alibaba Cloud.

Genymotion can emulate over 3,000 Android device configurations and simulate every imaginable scenario thanks to its full set of hardware sensors. The only problem is that you get only 60 minutes of use for free, and then it’s 5 cents per minute.

4. Android-x86

Android-x86 is a project whose aim is to port Android to the x86 instruction set. Because Android-x86 is a complete operating system, you need virtualization software like VirtualBox to run it inside your Linux distribution.

When setting up a VirtualBox virtual machine for Android-x86, Set Type to Linux, and Version to Linux 2.6 or newer. Allocate at least 2 GB of RAM and create a new hard disk image with 8 GB of storage space or more. Load the Android-x86 installation image and follow the official installation instructions.

When running Android-x86 inside a virtual machine, you can’t really expect great performance because Android-x86 is meant to run on bare metal.

5. Android Studio IDE

Android Studio IDE is Google’s official integrated development environment for Android. It’s built on JetBrains’ IntelliJ IDEA software and runs on Linux, Windows, macOS, and Chrome OS. Included with Android Studio IDE is an Android emulator intended for running and debugging apps in the Android studio.

To install the emulator, choose the Android Emulator component in the SDK Tools tab of the SDK Manager. Open the app you want to run and click the green play-like button in the menu bars at the top. When asked to choose a device, click the Create New Virtual Device button and specify its properties. Once you’re finished, select it from the list of available virtual devices and click OK. The virtual device should start up right away and automatically open your application.

The Android Emulator inside Android Studio IDE doesn’t exactly amaze with its performance or usability, but it gets the job done when you just want to run a single Android app on Linux without installing it on your smartphone.

About the author

David Morelo

David Morelo is a professional content writer in the technology niche, covering everything from consumer products to emerging technologies and their cross-industry application

Источник

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