简体   繁体   English

Genymotion 设备未出现在设备选择器上 - Android Studio

[英]Genymotion Device doesn't appear on Device Chooser - Android Studio

I installed Genymotion with a virtual Box and the Genymotion plugin (Android Studio), created a new device and runs properly, even from Android Studio.我安装了带有虚拟 Box 和 Genymotion 插件 (Android Studio) 的 Genymotion,创建了一个新设备并正常运行,即使是从 Android Studio 也是如此。

However when I hit the Run button, the Genymotion device does not appear on the Device Chooser, it says ' Nothing to Show ' under the 'Choose a running device' radio button.但是,当我点击运行按钮时,Genymotion 设备没有出现在设备选择器上,它在“选择正在运行的设备”单选按钮下显示没有显示”。 How can I get the Genymotion device to appear on the Device Chooser and run my app?如何让 Genymotion 设备出现在设备选择器上并运行我的应用程序? Is it something I am missing from the SDK manager?是我从 SDK 管理器中遗漏了什么吗?

This happens because Genymotion is shipped with outdated Android tools. 发生这种情况是因为Genymotion附带了过时的Android工具。 To solve follow the steps: 要解决以下步骤:

  • Open Genymotion app, 打开Genymotion应用程序,
  • Go to Settings -> ADB 转到设置 - > ADB
  • Select 'Use custom Android SDK tools' 选择“使用自定义Android SDK工具”
  • And select location of your Android SDK. 并选择Android SDK的位置。

On Mac with a recent version of Studio that would be: 在Mac上使用最新版本的Studio,它将是:

/Users/username/Library/Android/sdk/

I had the same problem, but I solved it. 我有同样的问题,但我解决了。

Before running genymotion you have to first click on run and wait until project compile and show you the empty device list and then you have to start your genymotion , after that it will appear. 在运行genymotion之前,你必须先点击运行并等到项目编译并显示空的设备列表,然后你必须启动你的genymotion ,之后它会出现。

  1. click the run button to compile project 单击运行按钮以编译项目
  2. device empty list appear 设备空列表出现
  3. start genymotion 开始genymotion
  4. device will appear in the list 设备将出现在列表中

That worked for me. 这对我有用。 Hope it helps. 希望能帮助到你。

Got the same issue on AS 3.3.2, I tried to select location of the Android SDK, or kill / restart the server. 在AS 3.3.2上遇到同样的问题,我试图选择Android SDK的位置,或者杀死/重启服务器。 Still they didn't work. 他们仍然没有工作。

After that, I install the genymotion plugin in AS and open the genymotion device manager, then check the actual ip address of the active genymotion device. 之后,我在AS中安装genymotion插件并打开genymotion设备管理器,然后检查活动genymotion设备的实际IP地址

在此输入图像描述

adb connect device_ip_address:5555

Now the device can be detected on device chooser. 现在可以在设备选择器上检测设备。

PS Thanks @Ismail Iqbal for pointing out that the genymotion plugin is not necessary. PS谢谢@Ismail Iqbal指出genymotion插件不是必需的。 You can also get the ip address from the emulator header. 您还可以从模拟器头中获取IP地址。

I also am facing the same issue in new version of Android studio. 我也在新版Android Studio中面临同样的问题。 following is my routine that everyday i am doing to solve this issue: 以下是我每天都在做的解决这个问题的例程:

  1. Click Run icon to see empty list of device 单击“运行”图标以查看设备的空列表

  2. Close this list 关闭此列表

  3. Kill adb by: 杀死adb:

     adb kill-server 

    Sometime you need to run this command twice. 有时您需要运行此命令两次。

  4. Start adb again by: 再次启动adb:

     adb start-server 
  5. Click run again. 再次单击运行。 Now I will see list of my emulators but not my Genymotion that is already up and running! 现在我将看到我的模拟器列表,但不是我已经启动并运行的Genymotion!

  6. I will add my Genymotion by: 我将通过以下方式添加我的Genymotion:

     adb connect 192.168.56.101 

    This command has to be run when select device dialog is still open. 当选择设备对话框仍处于打开状态时,必须运行此命令。

Now everything will be OK. 现在一切都会好的。

On Android Studio 2 : Android Studio 2上

  1. Click on button " Attach debugger to Android process " on Toolbar . 单击工具栏上的“ 将调试器附加到Android进程 ”按钮。
  2. Click restart . 单击重启
  3. Try run again. 再试一次。

Goodluck. 祝好运。

  1. Tools->Android-> Remove check "Enable ADB Integration" 工具 - > Android->删除选中“启用ADB集成”
  2. Run your app with appeared device.( you will get an error) 使用已出现的设备运行您的应用程序。(您将收到错误消息)
  3. Set check "Enable ADB Integration" 设置选中“启用ADB集成”
  4. Run your app 运行你的应用程序

You can solve it quickly. 你可以快速解决它。

First make sure that genymotion emulator is opend. 首先确保genymotion模拟器是opend。

  1. close device chooser (On andoid studio) 关闭设备选择器(On andoid studio)

  2. open task manager(on windows ctrl + shift + esc) 打开任务管理器(在windows ctrl + shift + esc上)

  3. pick process tab 选择流程选项卡

  4. find adb.exe maybe its adb.exe*32 找到adb.exe可能是它的adb.exe * 32

  5. right click and select kill process tree 右键单击并选择kill process tree

  6. adb will again appear shortly kill its process tree again( maybe more than one adb will be found kill all.) adb将再次出现,很快就会杀死它的进程树(可能会发现多个adb会被杀死。)

  7. then open device chooser (click run on android studio). 然后打开设备选择器(点击android studio上运行)。

在此输入图像描述 在此输入图像描述 在此输入图像描述

I solved mine by: 我解决了我的问题:

First start android studio before starting genymotion. 首先在启动genymotion之前启动android studio。 Then run the app in android studio and wait until you see the device chooser then start genymotion 然后在android studio中运行应用程序并等到你看到设备选择器然后启动genymotion

When you close the device, it is no longer available to the device chooser. 关闭设备后,设备选择器将无法再使用该设备。 You need to keep running the device from Android Studio. 您需要继续从Android Studio运行设备。

I tried adb kill-server/start-server . 我试过adb kill-server/start-server But, It didn't worked. 但是,它没有奏效。

Instead hitting this command 2-3 times quickly worked. 而是迅速打了2-3次这个命令。

adb reconnect

在我的情况下没有设置genymotion路径..所以我通过单击工具栏中的genymotion图标并输入路径(Windows中的默认值为C:\\ Program Files \\ Genymobile \\ Genymotion)解决了它,然后启动模拟器后现在出现在android studio中

Just in case someone is still looking for an answer. 以防有人仍在寻找答案。 The software versions in which i faced the 我面对的软件版本
above issuue is - 以上发行是 -

Android Studio - 3.3.2 Android Studio - 3.3.2
Genymotion - 3.0.1 Genymotion - 3.0.1

So, now let's start with the problem. 那么,现在让我们从问题开始吧。 Just try the following steps: 只需尝试以下步骤:

  1. Check if you have enabled Genymotion Plugin in Android Studio. 检查您是否在Android Studio中启用了Genymotion插件 For Windows, go to 对于Windows,请转到
    File -> Settings -> Plugins -> Search for Genymotion and see if it is checked. 文件 - > 设置 - > 插件 - > 搜索Genymotion并查看是否已选中。 If you can't find it, Click on Browse repositories , search for Genymotion and install it. 如果找不到,请单击“ 浏览存储库” ,搜索Genymotion并进行安装。

    Check the tick in the plugin: 检查插件中的勾号:

    检查插件中的勾号

  2. Check if the Genymotion Emulator is running or not and Genymotion Main Screen shows status as Running or ON (This was my problem. Although my emulator was up and running but Genymotion's Status was showing Booting). 检查Genymotion仿真器是否正在运行, Genymotion主屏幕显示状态为RunningON (这是我的问题。虽然我的模拟器启动并运行但是Genymotion的状态显示为Booting)。 It usually takes some time to get the status from Booting to ON 通常需要一些时间才能将状态Booting转为ON

    Check for emulator status: 检查模拟器状态:

    检查仿真器状态

  3. Check if your Min SDK Version is less than the Emulator's SDK Version. 检查Min SDK版本是否小于模拟器的SDK版本。 I faced it quite a lot in my initial days. 我在最初几天遇到了很多。 For that, Go to your Module:app gradle file and see the Min SDK Version and the Emulators SDK Version is same or higher. 为此,转到Module:app gradle文件,查看Min SDK版本Emulators SDK Version是相同还是更高。

    Check for Min SDK Version as highlighted in the image: 检查图像中突出显示的Min SDK版本: **检查图像中突出显示的最小SDK版本**

Hope this helps. 希望这可以帮助。 If you still get any problem do let me know. 如果您仍然遇到任何问题请告诉我。

首先,您必须在genymotion启动后按genymotion图标从android工作室运行genymotion然后按下运行按钮,您将在部署目标对话框中看到genymotion设备选项。

In addition to the answers of this question : 除了这个问题的答案:

My problem was about windows viruses , Last days i turned off my windows defender and i have't any other antivirus software in my system . 我的问题是关于Windows病毒 ,最近几天我关闭了我的Windows防御者 ,我的系统中没有任何其他防病毒软件。

My SDK folder was full of virus , when i scanned Many viruses detected . 当我扫描时,我的SDK文件夹中充满了病毒 。检测到许多病毒。

After removing viruses from my PC i had to remove SDK completely and download it again . 从我的PC中删除病毒后,我必须完全删除SDK并再次下载。

Finally notice that : For any reason , if the SDK files are damaged may cause this error . 最后请注意:由于任何原因,如果SDK文件损坏可能会导致此错误。

Now the problem is solved . 现在问题解决了

enter image description here For This Problem Go to Project structure/project in project SDK select simulator api version.在此处输入图像描述对于此问题转到项目 SDK 中的项目结构/项目选择模拟器 api 版本。 finish.now your genydevice added in list.完成。现在您的 genydevice 已添加到列表中。

I've tried from the android studio version 2.0 and the version 2.1, both does not compitable to genymotion. 我试过从Android工作室版本2.0和版本2.1,两者都不兼容genymotion。 please use the version 1.5.1 or older than that. 请使用版本1.5.1或更早版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM