Android sdk linux emulator

Содержание
  1. 7 лучших Android-эмуляторов Linux в 2021 году
  2. Зачем использовать эмулятор Android?
  3. Лучший эмулятор Android Linux
  4. 1. Andro VM
  5. Загрузите сейчас: Andro VM
  6. 2. Android-x86
  7. Загрузить сейчас: Android-x86
  8. 3. Andy OS
  9. Загрузить сейчас: Andy OS
  10. 4. Android SDK
  11. Загрузить сейчас: Google
  12. 5. Anbox
  13. Загрузить сейчас: Anbox
  14. 6. GenyMotion
  15. Загрузить сейчас: GenyMotion
  16. 7. Банка с фасолью
  17. Вердикт о лучшем эмуляторе Android для Linux
  18. Android
  19. Contents
  20. Transferring files
  21. App development
  22. Android Studio
  23. SDK packages
  24. Android Emulator
  25. Other SDK packages in the AUR
  26. Making /opt/android-sdk group-writeable
  27. Other IDEs
  28. Netbeans
  29. Vim / Neovim
  30. Emacs
  31. Other Tools
  32. Marvin
  33. Building
  34. Required packages
  35. Java Development Kit
  36. Setting up the build environment
  37. Downloading the source code
  38. Building the code
  39. Testing the build
  40. Creating a flashable Image
  41. Flashing
  42. Fastboot
  43. Samsung devices
  44. samloader
  45. Heimdall
  46. Odin (Virtualbox)
  47. Use Android on GNU/Linux
  48. Troubleshooting
  49. Android Studio: Android Virtual Devices show ‘failed to load’.
  50. Android Studio: ‘failed to create the SD card’
  51. Eclipse: During Debugging «Source not found»
  52. ValueError: unsupported pickle protocol
  53. libGL error: failed to load driver: swrast OR AVD does not load and no error message displayed
  54. sh: glxinfo: command not found
  55. Android Emulator: no keyboard input in xfwm4
  56. Android Emulator: Window is shaking and blinking when used in WM tiled mode
  57. Android Emulator: Segmentation fault (core dumped)
  58. adb: sideload connection failed: insufficient permissions for device

7 лучших Android-эмуляторов Linux в 2021 году

Если вы хотите использовать Android на своем ПК, вы можете. По крайней мере, так говорят многие пользователи Windows 10 — и они могут это сделать, поскольку для эмуляции Android на компьютере с Windows 10 доступно множество программного обеспечения. Но как насчет Linux? Linux набирает огромную популярность, особенно с появлением Windows 10. Если вы работаете с Linux или даже думаете о переходе на Linux, есть еще много лучших эмуляторов Android Linux, будь то для разработки или просто для беспорядка. вокруг с новыми технологиями и приложениями.

Зачем использовать эмулятор Android?

Эмуляторы Android могут быть полезны во многих случаях использования. Одна из замечательных возможностей эмуляторов Android — это возможность тестировать новые приложения на телефонах разных размеров и дисплеев. Поэтому, если вы разрабатываете новое приложение или игру для Android, эмуляторы дают вам возможность устранять неполадки в этом новом приложении, которое вы разрабатываете для устройства Android, и не иметь различных физических телефонов для тестирования (как и Android виртуальное устройство).

Эмуляторы Android также хороши для тех, кто просто любит платформу Android — если вы хотите играть на Android на своей машине Linux, эмулятор дает вам эту возможность! Варианты использования командной строки бесконечны! Вот наш выбор лучших эмуляторов Android.

Лучший эмулятор Android Linux

1. Andro VM

Для начала у нас есть Andro VM. Над этим проектом работают создатели Genymotion. Это один из самых простых вариантов настройки, требующий просто загрузить образ Linux с их веб-сайта. Затем вам нужно будет загрузить VirtualBox, в который вы сможете загрузить изображение. Затем вы можете свободно использовать и играть в приложения и игры на платформе Android по своему усмотрению!

Эмулятор Genymotion требует подключения к Интернету (Wi-Fi или мобильные данные) для использования эмулятора из-за использование облачных технологий после команды, но Android VM можно играть в автономном режиме!

Загрузите сейчас: Andro VM

2. Android-x86

Если вы хотите запустить Android в Ubuntu Linux, вы можете использовать ISO-файл Android x86 внутри виртуальной среды. Вы можете бесплатно скачать ISO-файл здесь. После его загрузки вам понадобится виртуальная среда (виртуальные устройства), чтобы вставить его. Вы можете сделать это с помощью бесплатной программы VirtualBox. Вы можете скачать это бесплатно здесь. После того, как вы загрузили и установили его, вы можете следовать инструкциям внутри программы, чтобы создать новую виртуальную машину. Вам нужно будет просто выбрать опцию Android, а затем, после создания, загрузить в него свой ISO-файл. Его довольно просто настроить, и VirtualBox имеет инструкции прямо со своего веб-сайта для Android X86. Вы можете выбрать 32-разрядную версию или 64-разрядную версию X86.

Загрузить сейчас: Android-x86

3. Andy OS

Andy OS — еще один отличный вариант, в котором говорится, что он разрушает барьеры между компьютером и мобильным телефоном. Он создает виртуальную среду в Ubuntu, Mac или другая среда Linux, что делает что-то подходящим для игр. Итак, если вы хотите запустить или начать возиться с некоторыми играми для Android в Linux, Andy OS — это то, что вам нужно. Вы можете играть практически в любую игру Android с Andy ОС, все зависит от того, сколько ресурсов вы выделяете виртуальной среде (дополненная реальность). Имея достаточно выделенных ресурсов, вы можете играть во что-то столь же требовательное, как Auralux или даже во что-то, созданное с помощью Unreal Engine.

Загрузить сейчас: Andy OS

4. Android SDK

Вы также можете использовать что-то прямо из Google: Android SDK. Вы можно загрузить Android SDK в среду рабочего стола Linux, а также в Android Studio, и это позволит Вы можете поиграть с различными приложениями Android прямо в программе. Вы можете поиграть с играми, обычными приложениями и даже посмотреть, как все выглядит в Интернете. Android SDK и Android Studio — это довольно большой файл, поэтому его загрузка и установка может занять некоторое время. Это работает так, что SDK и Studio вместе работают вместе для имитации программного обеспечения Android, но с использованием ресурсов вашего ПК. Разработчики Android в основном используют инструменты Android SDK для тестирования и разработки, но он также будет работать и для обычного использования, и для игр.

Читайте также:  Selectors in android xml

Загрузить сейчас: Google

5. Anbox

Если вы ищете что-то, посвященное эмуляции Android, Anbox доступен для большинства версий Linux, включая Mac. Anbox — это проект с открытым исходным кодом, сокращенно от Android In A Box. Это потому, что он открывает Android в виртуализированной среде, которая отображается в другом окне, как если бы это была любая другая программа. Вот почему он называется Anbox или Android In a Box, где «ящик» является метафорой окна. Он все еще находится в стадии разработки, но одна из идей заключается в том, что это не обязательно эмулятор, а способ преодолеть пространство между Android и ПК, предоставляя Android доступ к различным аппаратным функциям на вашем ПК, таким как аппаратное ускорение. . В настоящий момент он не поставляется с Google Play Store, но позволяет устанавливать сторонние приложения для Android. Если вы хотите запустить приложение, вам нужен только файл APK.

Загрузить сейчас: Anbox

6. GenyMotion

И последнее, но не менее важное: у нас есть GenyMotion, один из самых надежных, быстрых и эффективных эмуляторов Android для Linux.. Он работает аналогично Android SDK, но с гораздо большим разнообразием — GenyMotion в основном позволит разработчикам тестировать приложения на различных устройствах Android посредством эмуляции. Обычные пользователи по-прежнему могут использовать GenyMotion, чтобы увидеть, как игры, запуск приложений и веб-сайты работают на Android, а также на приложениях Android. Вы можете бесплатно скачать его на веб-сайте GenyMotion сразу после создания бесплатной учетной записи (с открытым исходным кодом).

Загрузить сейчас: GenyMotion

7. Банка с фасолью

Банка с фасолью занимает второе место в нашем обратном отсчете. Первоначально он был предназначен для платформы Windows, но Jar of Beans недавно получил поддержку Linux благодаря использованию Wine, запускающего эмулятор. Он имеет всю базовую поддержку Android, которую вы можете ожидать от такого эмулятора, включая возможность установки APK, поддержку SD-карты и даже использование Google Play Store (сервисы Google Play) для приложений Android/приложений Android.

Вердикт о лучшем эмуляторе Android для Linux

Как видите, существует множество отличных эмуляторов, которые позволят вам использовать платформу Android в Linux. На самом деле существует множество эмуляторов Android для Linux, в первую очередь потому, что ядро ​​операционной системы Android уже основано на операционной системе Linux, поэтому вы найдете множество эмуляторов для ОС Linux.

Любая из вышеперечисленных будет работать с большинством платформ Linux — это просто вопрос выбора того, какая из них работает для вас лучше всего. Вы, вероятно, обнаружите, что Android SDK имеет самые современные функции, а также предоставляет вам гораздо больше инструментов для устранения неполадок, но, опять же, все зависит от вашего варианта использования.

У вас есть любимые эмуляторы Android для Linux с последней версией Android? Не забудьте выключить звук в разделе комментариев ниже!

Источник

Android

Contents

Transferring files

There are various ways to transfer files between a computer and an Android device:

  • USB cable
    • Media Transfer Protocol for modern Android devices
    • USB mass storage for older devices
    • Android Debug Bridge
  • special USB sticks / regular USB stick with adapter
  • Bluetooth
  • Arch Linux software with Android counterparts
    • client or server for protocols that can be used to transfer files (eg. SSH, FTP, Samba or HTTP)
    • KDE Connect ( kdeconnect ) – integrates your Android device with the KDE or Gnome desktop (featuring synced notifications & clipboard, multimedia control, and file/URL sharing).
    • cloud synchronization clients
    • Syncthing
    • sendanywhereAUR – cross-platform file sharing
    • qrcpAUR – transfer files over wifi from your computer to your mobile device by scanning a QR code

App development

The officially supported way to build Android apps is to use #Android Studio.[1]

Android Studio

Android Studio is the official Android development environment based on IntelliJ IDEA. It provides integrated Android developer tools for development and debugging.

Android Studio creates a .android directory in home directory. To reset Android Studio, this directory can be removed.

The Android Studio Setup Wizard installs the required #SDK packages and places the SDK by default in

To build apps from the command-line (using e.g. ./gradlew assembleDebug ) set the ANDROID_SDK_ROOT environment variable to your SDK location.

SDK packages

Android SDK packages can be installed directly from upstream using #Android Studio’s SDK Manager or the sdkmanager command line tool (part of the Android SDK Tools). Some Android SDK packages are also available as AUR packages, they generally install to /opt/android-sdk/ .

Android SDK Package SDK-style path AUR package AUR dummy CLI tools
Command-Line Tools tools android-sdk-cmdline-tools-latest AUR android-sdk-cmdline-tools-latest-dummy AUR apkanalyzer, avdmanager, lint, retrace, screenshot2, sdkmanager
SDK Build-Tools build-tools;version android-sdk-build-tools AUR android-sdk-build-tools-dummy AUR aapt, aapt2, aidl, apksigner, bcc_compat, d8, dexdump, dx, lld, llvm-rs-cc, mainDexClases, split-select, zipalign
SDK Platform-Tools platform-tools android-sdk-platform-tools AUR android-sdk-platform-tools-dummy AUR adb, dmtracedump, e2fsdroid, etc1tool, #fastboot, hprof-conv, make_f2fs, make_f2fs_casefold, mke2fs, sload_f2fs, sqlite3, systrace
SDK Platform platforms;android-level android-platform AUR , older versions android-platform-dummy AUR (unnecessary)

The android-tools package provides adb, #fastboot, e2fsdroid and mke2fs.android from the SDK Platform-Tools along with mkbootimg and ext2simg .

Android Emulator

The Android Emulator is available as the emulator SDK package, the android-emulator AUR package, and there is also a dummy package for it: android-emulator-dummy AUR .

To run the Android Emulator you need an Intel or ARM System Image. You can install them through the AUR[2], with the sdkmanager or using Android Studio’s AVD Manager.

Читайте также:  Gps рулетка для андроид

Other SDK packages in the AUR

The Android Support Library is now available online from Google’s Maven repository. You can also install it offline through the extras;android;m2repository SDK package (also available as android-support-repository AUR ).

Making /opt/android-sdk group-writeable

The factual accuracy of this article or section is disputed.

The AUR packages install the SDK in /opt/android-sdk/ . This directory has root permissions, so keep in mind to run sdk manager as root. If you intend to use it as a regular user, create the android-sdk users group, add your user.

Set an access control list to let members of the newly created group write into the android-sdk folder. As running sdkmanager can also create new files, set the ACL as default ACL. the X in the default group entry means «allow execution if executable by the owner (or anyone else)»

Re-login or as log your terminal in to the newly created group:

Other IDEs

Android Studio is the official Android development environment based on IntelliJ IDEA. Alternatively, you can use Netbeans with the NBAndroid-V2. All are described below.

Netbeans

If you prefer using Netbeans as your IDE and want to develop Android applications, use NBAndroid-V2 .

Install android-sdk AUR package and follow the instructions from the NBANDROID README.

Vim / Neovim

It is possible to write flutter applications for Android and iOS using (Neo)vim like an IDE. Install coc using a Vim plugin manager. Also install the coc-flutter extension for autocompletion (like in Android Studio) and to load the code into an Android emulator.

Emacs

To develop a mobile flutter application using Emacs, as the the official instruction at flutter.dev suggests, install lsp-dart.

Other Tools

Marvin

Marvin is a tool which helps beginners set up an Android development environment. Installing marvin_dsc AUR helps you set up the following things: JDK, Android SDK, IDE(s), and AVD.

Building

Please note that these instructions are based on the official AOSP build instructions. Other Android-derived systems such as LineageOS will often require extra steps.

Required packages

As of 2020/April, to build either AOSP 10 or LineageOS 17.1 you need (possibly a subset of) base-devel , multilib-devel , gcc , repo , git , gnupg , gperf , sdl , wxgtk2 , squashfs-tools , curl , ncurses , zlib , schedtool , perl-switch , zip , unzip , libxslt , bc , rsync , ccache , lib32-zlib , lib32-ncurses , lib32-readline , ncurses5-compat-libs AUR , lib32-ncurses5-compat-libs AUR , and a TTF font installed (e.g. ttf-dejavu ). In particular, no Python2 or Java are required, as they are provided by AOSP/Lineage. The aosp-devel AUR metapackage provides them all for simple installation.

Additionally, LineageOS requires the following packages: xml2 AUR , lzop , pngcrush , imagemagick . They can be installed with the lineageos-devel AUR metapackage.

The factual accuracy of this article or section is disputed.

Java Development Kit

The required JDK version depends on the Android version you are building:

  • For Android 9 (Pie) and up, Java is included with the Android source and no separate installation is needed.
  • For Android 7 and 8 (Nougat and Oreo), OpenJDK 8 is required, which is available with the jdk8-openjdk package.
  • For Android 5 and 6 (Lollipop and Marshmallow), OpenJDK 7 is required, which is available with the jdk7-openjdk package.

Set JAVA_HOME to avoid this requirement and match the Arch Linux installation path. Example:

This change will be valid only for the current terminal session.

Setting up the build environment

Create a directory to build.

The Android build process expects python to be python2. Prepend it to the PATH :

Alternatively, create a python2 virtual environment and activate it:

/android to reflect your build directory if different than above).

or (assuming build directory Data/Android_Build):

Downloading the source code

This will clone the repositories. You only need to do this the first time you build Android, or if you want to switch branches.

  • The repo has a -j switch that operates similarly to the one used with make . Since it controls the number of simultaneous downloads, you should adjust the value depending on downstream network bandwidth.
  • You will need to specify a branch (list of branches) to check out with the -b switch. If you leave the switch out, you will get the so-called master branch.

The -c switch will only sync the branch which is specified in the manifest, which in turn is determined by the branch specified with the -b switch, or the default branch set by the repository maintainer.

Wait a long time. Just the uncompiled source code, along with the .repo and .git directories that are used to keep track of it, are very large. As of Android 10, at least 250 GB of free disk space is required.

Building the code

This should do what you need for AOSP:

If you run lunch without arguments, it will ask what build you want to create. Use -j with a number between one and two times number of cores/threads.

The build takes a very long time.

Testing the build

When finished, run/test the final image(s).

Creating a flashable Image

To create an image that can be flashed it is necessary to:

This will create a zip image under out/target/product/hammerhead (hammerhead being the device name) that can be flashed.

Flashing

In some cases, you want to return to the stock Android after flashing custom ROMs to your Android mobile device. For flashing instructions of your device, please use XDA forums.

Читайте также:  Обои зенит для андроида

Fastboot

Fastboot (as well as ADB) is included in the android-tools package.

Samsung devices

Samsung devices cannot be flashed using Fastboot tool. Alternatives are Heimdall and Odin (by using Windows and VirtualBox).

samloader

To download original Samsung firmware, a platform independent script, samloader can be used.

Heimdall

Heimdall is a cross-platform open-source tool suite used to flash firmware (also known as ROMs) onto Samsung mobile devices and is also known as an alternative to Odin. It can be installed as heimdall .

The flashing instructions can be found on Heimdall’s GitHub repository or on XDA forums.

Odin (Virtualbox)

It is also possible to restore firmware (Android) on the Samsung devices using Odin, but inside the VirtualBox.

Arch Linux (host) preparation:

  1. Install VirtualBox together with its extension pack and guest additions.
  2. Install your preferred, but compatible with Odin, Windows operating system (with VirtualBox guest additions) into a virtual hard drive using VirtualBox.
  3. Open VirtualBox settings of your Windows operating system, navigate to USB, then tick (or make sure it is ticked) Enable USB 2.0 (EHCI) Controller.
  4. At VirtualBox running Windows operating system, click in the menu bar Devices > USB Devices, then click on your Samsung mobile device from the list, which is connected to your computer via USB.

Windows (guest) preparation:

Check if configuration is working:

  1. Turn your device into Download mode and connect to your Linux machine.
  2. In virtual machine toolbar, select Devices > USB > . Samsung. device.
  3. Open Odin. The white box (a big one at the bottom-left side) named Message, should print a line similar to this:

which means that your device is visible to Odin & Windows operating system and is ready to be flashed.

Use Android on GNU/Linux

There are several projects and methods which support running Android on GNU/Linux:

  • Anbox: container-based software to run Android on Linux kernels
  • Android-x86: a direct port of Android for the x86 architecture

Troubleshooting

Android Studio: Android Virtual Devices show ‘failed to load’.

Make sure you have exported the variable ANDROID_HOME as explained in #Android Studio.

Android Studio: ‘failed to create the SD card’

If you try to run an AVD (Android Virtual Device) under x86_64 Arch and get the error above, install the lib32-gcc-libs package from the multilib repository.

Eclipse: During Debugging «Source not found»

Most probably the debugger wants to step into the Java code. As the source code of Android does not come with the Android SDK, this leads to an error. The best solution is to use step filters to not jump into the Java source code. Step filters are not activated by default. To activate them: Window > Preferences > Java > Debug > Step Filtering. Consider to select them all. If appropriate you can add the android.* package. See the forum post for more information: http://www.eclipsezone.com/eclipse/forums/t83338.rhtml

ValueError: unsupported pickle protocol

One fix is to issue:

If that does not work, then try this:

libGL error: failed to load driver: swrast OR AVD does not load and no error message displayed

Sometimes, beginning to load an AVD will cause an error message similar to this to be displayed, or the loading process will appear to finish but no AVD will load and no error message will be displayed.

The AVD loads an incorrect version of libstdc++, you can remove the folder libstdc++ from

/.android-sdk/emulator/lib64 (for 64-bit) or

/.android-sdk/emulator/lib (for 32-bit) , e.g.:

Note that in versions before Android Studio 3.0, this directory was in a different location:

Alternatively you can set and export ANDROID_EMULATOR_USE_SYSTEM_LIBS in

Fix for the .desktop file might be achieved by using env command, prefixing the Exec line Desktop entries#Modify environment variables

sh: glxinfo: command not found

Here is the full error:

You can try to install glxinfo ( mesa-utils ) but if your computer has enough power you could simply use software to render graphics. To do so, go to Tools > Android > AVD Manager, edit the AVD (click the pencil icon), then select Software — GLES 2.0 for Emulated Performance > Graphics.

Android Emulator: no keyboard input in xfwm4

In xfwm4, the vertical toolbar buttons window that is on the right of the emulator takes focus from the emulator and consumes keyboard events. (bug report)

You can use the workaround described in [3]:

  1. Open the xfwm4 settings.
  2. Switch to the Focus tab.
  3. Change the Focus Model to «Focus follow mouse».
  4. Disable Automatically raise windows when they receive focus option below.\

Android Emulator: Window is shaking and blinking when used in WM tiled mode

When using Tiled Window Manager like dwm, Android Emulator will shake and blink. You can use the workaround described in krohnkite issue 72 (window floating is induced by Alt+f in dwm).

Android Emulator: Segmentation fault (core dumped)

When using Nouveau drivers try to disable gpu hardware acceleration.

In some devices it can only be done by editing $HOME/.avd/device_name.avd/config.ini .[4]

  1. Set hw.gpu.enabled=no
  2. Set hw.gpu.mode=off

adb: sideload connection failed: insufficient permissions for device

If you get the error:

you might solve it by restarting the adb server:

Источник

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