Как связать android studio и genymotion

Обновлено: 02.05.2024

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

Установка Genymotion, бесплатная версия

Шаг 1 - установка VirtualBox

Загрузите и установите VirtualBox в соответствии с вашей операционной системой. , требуется запустить Genymotion .

Шаг 2 - загрузка Genymotion

Перейдите на страницу загрузки Genymotion и загрузите Genymotion соответствии с вашей операционной системой.

Примечание. Вам нужно будет создать новую учетную запись или войти в свою учетную запись.

Шаг 3 - Установка Genymotion

если в Linux то обратитесь к этому ответу , чтобы установить и запустить .bin файл.

Шаг 4 - Установка эмуляторов Genymotion

Шаг 5 - Интеграция genymotion с Android Studio

Genymotion , можно интегрировать с Android Studio через плагин, здесь шаги по установке в Android Studio

  • перейдите в раздел «Файл / Настройки» (для Windows и Linux) или в Android Studio / Preferences (для Mac OS X)
  • Выберите «Плагины» и нажмите «Обзор репозиториев».
  • Щелкните правой кнопкой мыши на Genymotion и нажмите «Загрузить и установите».

Теперь вы можете увидеть значок плагина, см. Это изображение

Обратите внимание: вы можете отобразить панель инструментов, нажав «Просмотр»> «Панель инструментов».

Шаг 6 - Запуск Genymotion из Android Studio

  • перейдите в раздел «Файл / Настройки» (для Windows и Linux) или в Android Studio / Preferences (для Mac OS X)
  • перейдите в раздел Другие настройки / Genymotion и добавьте путь Genymotion's папке Genymotion's и примените свои изменения.

Теперь вы можете запустить эмулятор Genymotion's нажав значок плагина и выбрав установленный эмулятор, а затем нажмите кнопку запуска!

Рамка Google для Genymotion

Если разработчики хотят тестировать Карты Google или любые другие сервисы Google, такие как Gmail, Youtube, Google диск и т. Д., То сначала им нужно установить Google framework на Genymotion. Вот шаги: -

This section gives you information about Genymotion plugins for Android Studio.

Genymotion plugin for Eclipse

The Genymotion plugin for Eclipse is no longer maintained and we no longer support nor distribute it.

Genymotion plugin for Android Studio¶

The Genymotion plugin for Android Studio allows you to test your application developed with the Android Studio IDE. It uses ADB to connect to any active virtual device and push your application.

This section explains how to install, use the plugin and run Android applications.

Pre-requisite¶

You need to set Genymotion Desktop to use the same Android SDK tool (adb) as Android Studio.
Please see ADB chapter for instructions.

Installing the plugin¶

You can install Genymotion plugin for Android Studio from AS marketplace:

  1. Start Android Studio.
  2. Go to:
    • Windows and Linux: File/Settings
    • macOS: Android Studio/Preferences
  3. Select Plugins and go to Marketplace.
  4. Type Genymotion in the search box.
  5. Click Install, then Apply and OK.

Using the plugin¶

The toolbar, where Genymotion plugin icon is displayed, is hidden by default. To display it, click View → Appearance and select Toolbar (View → Toolbar for older versions).

To start using the plugin:

  1. Click from the Android Studio toolbar. The following window opens:
  2. Browse for the [Genymotion] application installation directory:
  3. Windows: C:\Program Files\Genymobile\Genymotion
  4. macOS: /Applications/Genymotion.app
  5. Linux: /home//genymotion or /opt/genymotion
  6. Click OK.
  7. Click to open the Genymotion Device Manager window:

    From this window, you can perform the following actions:
  8. Create a new virtual device using New This automatically starts the Genymotion creation wizard.
  9. Start a virtual device using Start
  10. Refresh the list of virtual devices using Refresh.

The virtual device activation status is displayed in the Status column. Values can be:

  • Off: the virtual device is deactivated.
  • Paused: the virtual device has been started and paused. The Restart action gets back to the exact same state.
  • On: the virtual device is activated, but not connected to ADB. It means that you cannot select this virtual device in the Choose Device window of the ADB plugin.

Running Android applications¶

Run App

  1. Click from the Android Studio toolbar.
  2. Select the virtual device you want to use and click Start.
  3. Close the Genymotion window.
  4. In your application project, click . The Choose Device window opens.
  5. Click on the virtual device you started or created.
  6. Click OK.

Genymotion emulator is one of the most used Android Studio plugins where you can deploy and test your mobile apps. Here, we have brought a step by step tutorial to download, setup, and use Genymotion with Android Studio.

For your note, there is also a native emulator that you get as default with the Android Studio. But it is quite slow and lags far behind than functioning as a real mobile device. Also, there is no emulator which can completely replace an actual device. But Genymotion is picking up as the best and closest choice of Android developers/testers when it comes to comparing the emulators.

Download Genymotion Setup.

First of all, you need to download the Genymotion setup. Click on the below link to get the installer package.

Installation.

Once the download finishes, then use the steps given below to install the Android emulator.

  • Start the installation process by running the downloaded package.
  • Leave all the settings as is, continue to next steps and click on install.
  • You’ll see Virtual Box installation in between. In the last step, select to launch Genymotion.

Configuration.

After the above steps, you will find the Genymotion screen coming up.

  • The first dialogue box which will appear, ask you to add the first virtual device. Click yes.
  • You will find that no virtual devices are available.
    • It’ll need you to sign in.
    • Now various virtual devices will list.
    • Click next to retrieve and deploy the new virtual device.
    • It’ll take few seconds to complete, then click to finish.

    Android Studio Tutorial - Genymotion Emulator

    Setup Genymotion Emulator with Android Studio.

    It’ll now take a few more steps to add the Genymotion emulator plugin with Android Studio.

    Add Genymotion Emulator to Android Studio.

    • Run Android Studio and go to Files menu. Then, select the settings option.
    • Out of several options displayed, choose Plugin. You’ll see a button with labeled as Browse Repositories.
    • Search for the Genymotion emulator to add it to Android Studio.
    • Right click on the plugin package and Click Download and Install.
      • Click Yes for the message to confirm this Installation.
      • You should now see the Genymotion option under Plugins.

      Genymotion Emulator for Android Studio.

      Use Genymotion to Launch Virtual Device.

      After Android Studio is up again, look for a Genymotion icon inside the menu bar.

      • Click on the plugin icon.
      • Set the path to the Genymotion installation.
      • Now your Genymotion emulator should be ready to use.
      • Complete the process and click the Genymotion icon.
      • Following dialogue box will appear on the screen.

      Genymotion Emulator - Virtual Device Setup

      • Select one of the available devices and click on Start button.
      • Following Genymotion screen running the virtual device will now appear.
      • It is the target device where you can perform testing of your Android Apps.

      Genymotion Emulator

      Summary – Genymotion Emulator.

      Not all of us, especially those who are beginners won’t be willing to spare a real device to test the Android apps. Also, we shouldn’t use our personal phone for testing as it may cause data loss.

      But with Genymotion, it is easy to test and even debug any Android application. So all of you reading this post must give it a try.

      We wish this blog post would have given you a few points to start. However, if you have any query, then please comment and let us know.

      Best,

      TechBeamers.

      You Might Also Like

      How to Switch between Activities in Android

      How to Switch between Activities in Android

      Android Development Studio Tutorial for Beginners

      September 22, 2019

      Android Development Studio Tutorial for Beginners

      Android Studio Tutorial: Create Android App

      December 6, 2016

      I updated 0.5 to 0.8.14 version of android studio , but now studio doesn't see genymotion , what I must do now ? Thanks for all .

      Edit :I solved the problem by updating genymotion too

      10 Answers 10

      Genymotion by default uses it's own ADB binary. If it has a different version than the one Android Studio is using, they can conflict and you get lots of issues. One of them can be Genymotion not being detected, and problems deploying apps.

      I would recommend setting Genymotion to use the ADB/Android SDK that Android Studio is also using, instead of using the default one. That way you will avoid conflicts on future updates.

      enter image description here

      I have done it but it still conflicts. I'm using ubuntu linux 14.04 The issue is that I have created link /usr/bin/adb to my customly installed adb Then in genymotion I have provided my custom adb. But when I run genymotion emulator the console adb stops working. It tries to restart the server but can't

      I specified path to sdk (same as the one used by Android Studio) on Linux, and the small checkmark did not appear, but it did work. I was seeing it in adb devices before, but android studio didn't. After doing this, Restarted Android Studio and now it's working. Thanks for sharing this

      Thanks Christian. Your solution worked for me. I'm using Ubuntu 15.10 and I hadn't specified correct Android SDK path. It was set to default path.

      You MUST install the plug-in for Genymotion first, click the "File" tab locate the "Plug-in" option, down the bottom, search for Genymotion, then install. After the installation, you need to restart Android Studio, after that, you will see the Genymotion icon near the "Sdk Manager" icon, click on it, then just specify the location of your Genymotion installation. Also, make sure you have "Oracle Virtual Box" installed in order to use Genymotion, it is a requirement.

      enter image description here

      Edit-

      Then your genymotion virtual machines come up, click the one you want (I think it has to be off for start to be clickable/not greyed) then click start,

      enter image description here

      then click that green Play icon near the centre of the button bar below the menu bar, then the genymotion virtual machine should appear listed under 'running devices'. highlight it and click ok, and it should launch and show your program.

      I have followed many guides online but I am unable to run my apks through Genymotion.

      This is what I get when I try to run something:-

      enter image description here

      When I click "Run" I get a "Configuration is Still Incorrect. Do you want to edit it again.?" with two options :- "Edit" and "Continue Anyway".

      How do I solve this problem?

      3 Answers 3

      Have you added the Genymotion plugin. Go through this. Genymotion Plugin for Android Studio

      Seems like Android Studio is not picking up your module (so not a Genymotion problem). Ensure that one of the first lines in your module (not root project) build.gradle is this:

      On second thought the problem might be your folder structure. You opened the root project in . /bartalk-master but it is in reality located in . /bartalk-master/bartalk-master . Fix this and you should be good to go.

      Genymotion devices behave with ADB exactly like any USB device you plug into your computer.

      Considering your problem the window appears because Android Studio does not find a device to connect with : no USB device, no AVD (official emulator), and no Genymotion instance.

      The Target Device section, on the window, allows you to choose on what kind if device you want to launch your app. If you want to use Genymotion you can let it set Show chooser dialog or whether USB Devices .

      Now, what you should do is to be careful to have a Genymotion instance already launched before running your app.

      To be sure the connection is already done you can try to type adb devices you should see something like this:

      The : device line is the Genymotion instance currently running.

      Please give more details about your situation if this does not solve your problem.

      Читайте также: